-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
core/services: fix ocrWrapper saveError contexts #13139
Conversation
2a568c3
to
f5d8bee
Compare
f5d8bee
to
25bbde0
Compare
OffchainConfigDigester: configProvider.OffchainConfigDigester(), | ||
} | ||
lggr.Debugw("Launching new bootstrap node", "args", bootstrapNodeArgs) | ||
bootstrapper, err := ocr.NewBootstrapper(bootstrapNodeArgs) | ||
if err != nil { | ||
return nil, errors.Wrap(err, "error calling NewBootstrapNode") | ||
} | ||
return []job.ServiceCtx{configProvider, job.NewServiceAdapter(bootstrapper)}, nil | ||
return []job.ServiceCtx{configProvider, ocrLogger, job.NewServiceAdapter(bootstrapper)}, 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.
is ocrLogger to be wired through in bootstrapper
as well as on its own?
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.
The bootstrapper depends on it, but it doesn't understand that it needs to be closed, so it is not closed by the ServiceAdapter.Close()
call.
@@ -163,22 +162,23 @@ func (d *Delegate) ServicesForSpec(ctx context.Context, jb job.Job) (services [] | |||
"ContractTransmitterTransmitTimeout", lc.ContractTransmitterTransmitTimeout, | |||
"DatabaseTimeout", lc.DatabaseTimeout, | |||
) | |||
ocrLogger := ocrcommon.NewOCRWrapper(lggr.Named("OCRBootstrap"), d.ocr2Cfg.TraceLogging(), func(ctx context.Context, msg string) { |
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.
For my own understanding: the benefit of this is that now consumers of ocrLogger will provide their own context to saveError
rather than inheriting it from the delegate?
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.
Yes, it is tied to the lifecyle of the job now. Inheriting from the delegate method was the real problem. My first hack added a StopChan
backed Close()
method to the Delegate
s instead. That works but ties it to the lifecyle of the delegate itself, which is not cancelled until shutdown. This new approach manages the lifecycle appropriately, at the cost of a little code duplication where we used to be able to share.
25bbde0
to
c0d8075
Compare
Quality Gate passedIssues Measures |
(cherry picked from commit 15fab1d)
* Bump version and update CHANGELOG for core v2.12.0 Signed-off-by: Sneha Agnihotri <[email protected]> * core/services: fix ocrWrapper saveError contexts (#13139) (cherry picked from commit 15fab1d) * changed spammy error log to debug (#13153) (cherry picked from commit 3502176) * Updating changelog for 2.12.0 with cherry pick fix Signed-off-by: Sneha Agnihotri <[email protected]> * BCF-3225 - Implement forwarder fallback if forwarder not present as a transmitter on OCR2 aggregator (#13221) * Implement forwarder OCR2 fallback if fwd not present as a transmitter * Add changeset * Fix panic on mercury server error (#13231) (#13256) * Fix changelog * Fixed CPU usage issues caused by inefficiencies in HeadTracker (#13230) * Fixed CPU usage issues caused by inefficiencies in HeadTracker * added comments * revert heads back to the fix (cherry picked from commit 6f1ebca) * Update CHANGELOG for 2.12.0 bugfixes Signed-off-by: Sneha Agnihotri <[email protected]> * Decouple ChainType from config string [SHIP-2001] (#13272) * fix: Decouple ChainType from config string * fix: receiver name and failing test * test: enhance config test to test for xdai specifically * refactor: directly unmarshal into ChainType * fix: validation * test: fix TestDoc/EVM * test: add xdai to warnings.xtar * Index only the fifth word to reduce the db size overhead (#13315) Co-authored-by: Domino Valdano <[email protected]> * Add special transmitter for OCR2 feeds (#13323) * Add special transmitter for OCR2 feeds * Add ocr2FeedsTransmitter FromAddress() * Cherry-pick some forwarders context changes from (#13171) * Improve ocr2FeedsTransmitter FromAddress() fallback (#13343) * Improve ocr2FeedsTransmitter FromAddress() fallback * Fix forwarders test error assert * Update 2.12.0 Changelog with bugfixes Signed-off-by: Sneha Agnihotri <[email protected]> * core/services/pipeline: bridge task must continue after cancellation * core/services/pipeline: use request context for deletion (#13404) * core/services/pipeline: hide deadline from monitor * Finalize date on changelog for 2.12.0 Signed-off-by: Sneha Agnihotri <[email protected]> * Fix merge conflicts * Remove `overtimeThresholds` * Return to old version of pipeline-runner --------- Signed-off-by: Sneha Agnihotri <[email protected]> Co-authored-by: Jordan Krage <[email protected]> Co-authored-by: Patrick <[email protected]> Co-authored-by: ilija42 <[email protected]> Co-authored-by: Sam <[email protected]> Co-authored-by: Dmytro Haidashenko <[email protected]> Co-authored-by: Friedemann Fürst <[email protected]> Co-authored-by: Mateusz Sekara <[email protected]> Co-authored-by: Domino Valdano <[email protected]> Co-authored-by: ilija <[email protected]> Co-authored-by: frank zhu <[email protected]> Co-authored-by: george-dorin <[email protected]>
https://smartcontract-it.atlassian.net/browse/BCF-3221
The
saveError
func
s passed toNewOCRWrapper
were inheriting out-of-scopecontext.Context
s. This PR updates them to cancel onClose()
instead.