Skip to content

Commit

Permalink
Merge pull request #404 from SOF3/diff-writer-reelect
Browse files Browse the repository at this point in the history
fix(diff): always resyncMonitors the first time after acquiring watch leader lease
  • Loading branch information
SOF3 authored Feb 17, 2025
2 parents f00842a + af57115 commit fa7cef5
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 14 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ jobs:
</html>
EOF
- name: Upload pages artifact
uses: actions/upload-pages-artifact@v1
uses: actions/upload-pages-artifact@v3
with:
path: output

Expand All @@ -218,7 +218,7 @@ jobs:
concurrency:
group: gh-pages
steps:
- uses: actions/deploy-pages@v2
- uses: actions/deploy-pages@v4
id: deployment

publish-image:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,6 @@ jobs:
runs-on: [ubuntu-20.04]
steps:
- uses: actions/checkout@v3
- uses: crate-ci/typos@master
- uses: crate-ci/typos@v1.29.5
with:
config: hack/typos.toml
22 changes: 11 additions & 11 deletions pkg/diff/controller/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -306,6 +306,17 @@ func (ctrl *controller) resyncMonitorsLoop(ctx context.Context) {
go writeElector.RunLeaderMetricLoop(ctx)

for {
err := retry.OnError(retry.DefaultBackoff, func(_ error) bool { return true }, func() error {
err := ctrl.resyncMonitors(ctx)
if err != nil {
logger.WithError(err).Warn("resync monitors")
}
return err
})
if err != nil {
logger.WithError(err).Error("resync monitors failed")
}

stopped := false

select {
Expand All @@ -317,17 +328,6 @@ func (ctrl *controller) resyncMonitorsLoop(ctx context.Context) {
if stopped {
break
}

err := retry.OnError(retry.DefaultBackoff, func(_ error) bool { return true }, func() error {
err := ctrl.resyncMonitors(ctx)
if err != nil {
logger.WithError(err).Warn("resync monitors")
}
return err
})
if err != nil {
logger.WithError(err).Error("resync monitors failed")
}
}

ctrl.monitorsLock.Lock()
Expand Down

0 comments on commit fa7cef5

Please sign in to comment.