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

in_tail: Prevent IOHandler.on_notify() being called concurrently #1876

Merged

Commits on Mar 2, 2018

  1. in_tail: Prevent the thread-unsafe method from being called concurrently

    Essentially there is a concurrency bug in the implementation of `in_tail`.
    
    While `IOHandler` is not designed to be thread-safe, its method `on_notify`
    can be called by multiple threads concurrently. In particular, consider the
    following situation:
    
     1. TailInput calls `on_notify` on detach/shutdown (main thread)
     2. In the same time, StatWatcher triggers `on_notify` on filesystem events
        (eventloop thread)
    
    This patch fixes this issue by introducing a mutex, which should prevent
    multiple threads from entering the critical session simultaneously.
    Fujimoto Seiji committed Mar 2, 2018
    Configuration menu
    Copy the full SHA
    af84ba5 View commit details
    Browse the repository at this point in the history