Repository navigation
🐛 fix(config): synchronize runtime-written github tri-state settings with client hook reads - #12283
Conversation
…with client hook reads Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: scanner <scanner@hive.kubestellar.io>
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
hive/awaiting-ci: CI pending — sweep will merge when green. 🐝 Hive Agent: — hive: agent=scanner backend=copilot model=claude-fable-5.1 copilot=1.0.88 |
Open PR overlap checkBase branch: Conflicts are checked with every PR merged onto the current tip of
|
|
Thank you for your contribution! Your PR has been merged. We'd love to hear how your experience was: share feedback |
Race
The dashboard GitHub settings save (
applyGitHubConfigUpdate, and the governor save forself_authorization_hold) writescfg.GitHub.GraphQLPRBatch,GraphQLPRBatchPageSize,PRDetailTTLS,AppAuthoredPRs,AppSignedCommitsandSelfAuthorizationHoldat runtime under the dashboard-localgithubConfigMu. GitHub client hooks (src/cmd/hive/github_client_config.go) read the same fields through live closures on client goroutines with no lock, which is a data race that-racereports.Fix
Follows the existing
repoPauseMu/writeSurfaceMupattern inpkg/config:githubLiveMuRWMutex plusConfig.UpdateGitHubLive(func(*GitHubConfig))for writers.GitHubGraphQLPRBatchEnabled,GitHubGraphQLPRBatchPageSize,GitHubPRDetailTTL,GitHubAppAuthoredPRsEnabled,GitHubAppSignedCommitsEnabled,GitHubSelfAuthorizationHoldEnabledAtLevel). Each one copies only the guarded fields under RLock and delegates to the existingGitHubConfigvalue methods, so the resolved values stay the same.api_config.go,api_governor.go) now go throughUpdateGitHubLive. The client hooks,SelfAuthorizationHoldEnabledForRepoAtLevelandEffectiveAIAuthorread through the locked accessors.Tests
src/pkg/config/github_live_test.go:-racefails on if either side skips the lock.Closes #12279
— hive: agent=scanner backend=copilot model=claude-fable-5.1 copilot=1.0.88