diff --git a/src/box/iproto.cc b/src/box/iproto.cc index cb60c0188373f0236fbfecbf55ca5440a0c2f4a2..8e09976b31305007491fc2b3399817702831c225 100644 --- a/src/box/iproto.cc +++ b/src/box/iproto.cc @@ -111,7 +111,7 @@ struct IprotoRequestGuard { struct iproto_task; -enum { IPROTO_REQUEST_QUEUE_SIZE = 2048, }; +enum { IPROTO_REQUEST_QUEUE_SIZE = 2048, IPROTO_FIBER_CACHE_IDLE_TIMEOUT = 3 }; /** * Implementation of an input queue of the box request processor. @@ -617,7 +617,11 @@ iproto_tx_queue_fiber(va_list ap) } /** Put the current fiber into a queue fiber cache. */ rlist_add_entry(&i_queue->fiber_cache, fiber(), state); - fiber_yield(); + bool timed_out = fiber_yield_timeout(IPROTO_FIBER_CACHE_IDLE_TIMEOUT); + if (timed_out) { + rlist_del_entry(fiber(), state); + return; + } goto restart; }