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

AMLII-1842 Fix a potential deadlock on fork #836

Merged
merged 2 commits into from
Aug 12, 2024
Merged

AMLII-1842 Fix a potential deadlock on fork #836

merged 2 commits into from
Aug 12, 2024

Commits on Jun 24, 2024

  1. Fix a potential deadlock on fork

    If a fork happens while some thread is sending metrics and holds one
    of the locks, the lock would remain locked in the child process and
    would deadlock, either in the post_fork handler (when the post_fork
    hook tries to close the socket), or later (when user code tries to
    send a metric).
    
    Work around the issue by resetting the socket and buffer locks in the
    child process. If those were locked in the parent at the time of the
    fork, the internal client state may be inconsistent, so we reset it as
    well.
    
    With config lock, we can not reset the state to some known good state,
    and to avoid problems when fork is called while a thread modifies the
    client configuration, the config lock will be held across fork. Both
    the client and the parent can safely unlock it afterwards.
    vickenty committed Jun 24, 2024
    Configuration menu
    Copy the full SHA
    b7cab0a View commit details
    Browse the repository at this point in the history

Commits on Aug 12, 2024

  1. Configuration menu
    Copy the full SHA
    155cd37 View commit details
    Browse the repository at this point in the history