Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fsmonitor: fix hangs by delayed fs event listening #1804

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Commits on Oct 2, 2024

  1. fsmonitor: fix hangs by delayed fs event listening

    The thread serving the client (ipc-thread) calls
    with_lock__wait_for_cookie() in which a cookie file is
    created. with_lock__wait_for_cookie() then waits for the event caused by
    the cookie file from the thread for fs events (fsevent-thread).
    
    However, in high load situations, the fsevent-thread may start actual fs
    event listening (triggered by FSEventStreamStart() for Darwin, for
    example) *after* the cookie file is created. In this case, the
    fsevent-thread cannot detect the cookie file and
    with_lock__wait_for_cookie() waits forever, so that the whole daemon
    hangs [1].
    
    Extend listen_error_code to express that actual fs event listening
    starts. listen_error_code is accessed in a thread-safe manner by
    utilizing a dedicated mutex.
    
    [1]: https://lore.kernel.org/git/[email protected]/
    
    Suggested-by: Jeff King <[email protected]>
    Signed-off-by: Koji Nakamaru <[email protected]>
    KojiNakamaru committed Oct 2, 2024
    Configuration menu
    Copy the full SHA
    83c6040 View commit details
    Browse the repository at this point in the history