-
Notifications
You must be signed in to change notification settings - Fork 113
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
DATA-1419 | DATA-861 - Check sync config in reconfigure #2309
DATA-1419 | DATA-861 - Check sync config in reconfigure #2309
Conversation
@@ -426,12 +428,16 @@ func (svc *builtIn) Reconfigure( | |||
} | |||
svc.collectors = newCollectors | |||
|
|||
if svc.syncDisabled == svcConfig.ScheduledSyncDisabled && | |||
svc.syncIntervalMins == svcConfig.SyncIntervalMins && | |||
reflect.DeepEqual(svc.additionalSyncPaths, svcConfig.AdditionalSyncPaths) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Only use reflection when necessary because it's incredibly slow, should use a string slice method here
@@ -98,6 +99,7 @@ type builtIn struct { | |||
syncerConstructor datasync.ManagerConstructor | |||
cloudConnSvc cloud.ConnectionService | |||
cloudConn rpc.ClientConn | |||
ticker *clk.Ticker |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Include use/purpose in name, syncTicker or something
@@ -447,6 +453,10 @@ func (svc *builtIn) Reconfigure( | |||
svc.startSyncScheduler(svc.syncIntervalMins) | |||
} else { | |||
svc.closeSyncer() | |||
if svc.ticker != nil { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be done before closing the syncer? If this ticks between these two lines, would there be a risk of a NPE?
svc.backgroundWorkers.Add(1) | ||
goutils.PanicCapturingGo(func() { | ||
defer svc.backgroundWorkers.Done() | ||
defer ticker.Stop() | ||
defer svc.ticker.Stop() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is calling svc.ticker.Stop() safe? Just making sure since this is being deferred and also called explicitly elsewhere
@@ -426,12 +428,16 @@ func (svc *builtIn) Reconfigure( | |||
} | |||
svc.collectors = newCollectors | |||
|
|||
if svc.syncDisabled == svcConfig.ScheduledSyncDisabled && | |||
svc.syncIntervalMins == svcConfig.SyncIntervalMins && | |||
reflect.DeepEqual(svc.additionalSyncPaths, svcConfig.AdditionalSyncPaths) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think the additional paths changing needs to impact the sync ticker. More of a product question ig but I'd lean towards removing this part of the check
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚀
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Talked through everything offline and have done tons of manual testing, thank you! Really amazing work on catching the various bugs, troubleshooting, and fixing quickly 🚀
|
Fix:
Test: