Skip to content
Snippets Groups Projects
  • Konstantin Osipov's avatar
    2d266be4
    box: respond to signals during recovery from a local snapshot/xlog. · 2d266be4
    Konstantin Osipov authored
    We already install signal handlers, but don't give them a chance
    to execute, since don't yield during recovery. Add yields once
    per a few tens of thousands of events.
    
    Deploy a special hack with an idle watcher to make sure that
    fiber_sleep(0) doesn't sleep for too long (1 ms without this
    watcher).
    
    libev sleeps for at least 1 ms (backend_mintime) unless there are
    idle watchers. The logic of this behaviour is obscure to say the
    least.
    
    Since the upstream is also using *screw-the-community* cvs for
    revision control, maintaining an own patch set on top of the
    upstream is also a pain in the neck.
    
    So, instead of patching libev (I hesitate to simply remove the
    obscure logic since I don't understand the reason for it from the
    comments, and I don't think making this logic optional is worth
    the hassle, given also that we will diverge even more from the
    upstream), create an idle watcher in fiber_sleep(), as a
    workaround, to make sure backend_mintime is not looked at when
    calculating sleep time for poll(), and zero timeout is used
    instead.
    2d266be4
    History
    box: respond to signals during recovery from a local snapshot/xlog.
    Konstantin Osipov authored
    We already install signal handlers, but don't give them a chance
    to execute, since don't yield during recovery. Add yields once
    per a few tens of thousands of events.
    
    Deploy a special hack with an idle watcher to make sure that
    fiber_sleep(0) doesn't sleep for too long (1 ms without this
    watcher).
    
    libev sleeps for at least 1 ms (backend_mintime) unless there are
    idle watchers. The logic of this behaviour is obscure to say the
    least.
    
    Since the upstream is also using *screw-the-community* cvs for
    revision control, maintaining an own patch set on top of the
    upstream is also a pain in the neck.
    
    So, instead of patching libev (I hesitate to simply remove the
    obscure logic since I don't understand the reason for it from the
    comments, and I don't think making this logic optional is worth
    the hassle, given also that we will diverge even more from the
    upstream), create an idle watcher in fiber_sleep(), as a
    workaround, to make sure backend_mintime is not looked at when
    calculating sleep time for poll(), and zero timeout is used
    instead.