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

Conversation

KojiNakamaru
Copy link

@KojiNakamaru KojiNakamaru commented Oct 2, 2024

cc: Jeff King [email protected]

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
Copy link
Author

/submit

Copy link

gitgitgadget bot commented Oct 2, 2024

Submitted as [email protected]

To fetch this version into FETCH_HEAD:

git fetch https://github.com/gitgitgadget/git/ pr-1804/KojiNakamaru/fix/fsmonitor-deadlock-v1

To fetch this version to local tag pr-1804/KojiNakamaru/fix/fsmonitor-deadlock-v1:

git fetch --no-tags https://github.com/gitgitgadget/git/ tag pr-1804/KojiNakamaru/fix/fsmonitor-deadlock-v1

Copy link

gitgitgadget bot commented Oct 2, 2024

This patch series was integrated into seen via git@e6e38f1.

@gitgitgadget gitgitgadget bot added the seen label Oct 2, 2024
Copy link

gitgitgadget bot commented Oct 3, 2024

This branch is now known as kn/fsmonitor-event-listener-fix.

Copy link

gitgitgadget bot commented Oct 3, 2024

This patch series was integrated into seen via git@1859bb5.

Copy link

gitgitgadget bot commented Oct 3, 2024

This patch series was integrated into seen via git@d60c7c7.

Copy link

gitgitgadget bot commented Oct 4, 2024

This patch series was integrated into seen via git@b64ab23.

Copy link

gitgitgadget bot commented Oct 4, 2024

This patch series was integrated into seen via git@bca997f.

Copy link

gitgitgadget bot commented Oct 5, 2024

This patch series was integrated into seen via git@514a9ae.

Copy link

gitgitgadget bot commented Oct 5, 2024

There was a status update in the "Cooking" section about the branch kn/fsmonitor-event-listener-fix on the Git mailing list:

Under high load, fsmonitor process can hang at start-up, which has
been corrected.

Comments?
source: <[email protected]>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant