Skip to content

Conversation

@cachemeifyoucan
Copy link

@cachemeifyoucan cachemeifyoucan commented Nov 14, 2025

  • Explanation: Fix a potential issue that can cause new clang scan daemon failed to start when the previous daemon timed out at the same time. It is possible for the timed out daemon still hold pid file when being shutdown, when the new clang daemon is starting up and failed to lock the pid file. To the new clang daemon, this is indistinguishable from losing the race to start a new daemon with another clang invocation, thus the new starting request will be dropped and no daemon will be started.
  • Scope: Affects clang cache build that uses daemon to integrate with legacy build systems.
  • Issues:
  • Original PRs: [ScanDaemon] unlock pid file first before unlink socket #11817
  • Risk: Low. caching build with daemon only and fixes a race condition.
  • Testing: N/A
  • Reviewers: @benlangmuir

Fix a potential issue that can cause new clang scan daemon failed to
start when the previous daemon timed out at the same time. It is
possible for the timed out daemon still hold pid file when being
shutdown, when the new clang daemon is starting up and failed to lock
the pid file. To the new clang daemon, this is indistinguishable from
losing the race to start a new daemon with another clang invocation,
thus the new starting request will be dropped and no daemon will be
started.

(cherry picked from commit 5595098)
@cachemeifyoucan cachemeifyoucan changed the title [ScanDaemon] unlock pid file first before unlink socket [6.3][ScanDaemon] unlock pid file first before unlink socket Nov 14, 2025
@cachemeifyoucan cachemeifyoucan requested a review from a team November 14, 2025 21:49
@cachemeifyoucan
Copy link
Author

@swift-ci please test

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant