Skip to content
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

[KS-616] asset job updates #15573

Merged
merged 7 commits into from
Dec 12, 2024
Merged

[KS-616] asset job updates #15573

merged 7 commits into from
Dec 12, 2024

Conversation

krehermann
Copy link
Contributor

@krehermann krehermann commented Dec 9, 2024

KS-616

Error observed when updating job but not when creating.

Traced to duplicate registration in the Loop Registry.

This was then traced to missing Unregister when the Job closes all it's sub services.

Requires

Supports

Copy link
Contributor

github-actions bot commented Dec 9, 2024

AER Report: CI Core ran successfully ✅

aer_workflow , commit

AER Report: Operator UI CI ran successfully ✅

aer_workflow , commit

@krehermann krehermann changed the title fix error handling [KS-616] asset job updates Dec 9, 2024
@krehermann krehermann marked this pull request as ready for review December 9, 2024 19:04
@krehermann krehermann requested review from a team as code owners December 9, 2024 19:04
@krehermann krehermann requested review from Atrax1, jmank88 and cedric-cordenier and removed request for Atrax1 December 9, 2024 19:04
@krehermann krehermann force-pushed the ks-616/update-asset-don-jobs branch from 687b2fc to 670c0b3 Compare December 9, 2024 19:15
jmank88
jmank88 previously approved these changes Dec 9, 2024
@krehermann krehermann requested a review from bolekk December 9, 2024 19:47
Copy link
Contributor

github-actions bot commented Dec 9, 2024

Flakeguard Summary

Setting Value
Project github.com/smartcontractkit/chainlink/v2
Max Pass Ratio 100.00%
Test Run Count 9
Race Detection false
Excluded Tests TestChainComponents

Found Flaky Tests ❌

Category Total
Tests 292
Panicked Tests 0
Raced Tests 0
Flaky Tests 4
Flaky Test Ratio 1.36%
Runs 876
Passes 872
Failures 4
Skips 0
Pass Ratio 99.54%
Name Pass Ratio Panicked? Timed Out? Race? Runs Successes Failures Skips Package Package Panicked? Avg Duration Code Owners
TestShell_CreateETHKey 66.67% false false false 3 2 1 0 github.com/smartcontractkit/chainlink/v2/core/cmd false 1.246666666s Unknown
TestShell_ImportExportETHKey_NoChains 66.67% false false false 3 2 1 0 github.com/smartcontractkit/chainlink/v2/core/cmd false 1.326666666s Unknown
TestShell_ImportExportETHKey_WithChains 66.67% false false false 3 2 1 0 github.com/smartcontractkit/chainlink/v2/core/cmd false 1.303333333s Unknown
TestShell_ListETHKeys 66.67% false false false 3 2 1 0 github.com/smartcontractkit/chainlink/v2/core/cmd false 1.256666666s Unknown

Copy link
Contributor

github-actions bot commented Dec 9, 2024

Flakeguard Summary

Setting Value
Project github.com/smartcontractkit/chainlink/v2
Max Pass Ratio 100.00%
Test Run Count 12
Race Detection false
Excluded Tests TestChainComponents

Found Flaky Tests ❌

Category Total
Tests 292
Panicked Tests 0
Raced Tests 0
Flaky Tests 5
Flaky Test Ratio 1.71%
Runs 1,665
Passes 1,659
Failures 6
Skips 0
Pass Ratio 99.63%
Name Pass Ratio Panicked? Timed Out? Race? Runs Successes Failures Skips Package Package Panicked? Avg Duration Code Owners
TestShell_CreateETHKey 83.33% false false false 6 5 1 0 github.com/smartcontractkit/chainlink/v2/core/cmd false 1.241666666s Unknown
TestShell_ImportExportETHKey_NoChains 83.33% false false false 6 5 1 0 github.com/smartcontractkit/chainlink/v2/core/cmd false 1.323333333s Unknown
TestShell_ImportExportETHKey_WithChains 66.67% false false false 6 4 2 0 github.com/smartcontractkit/chainlink/v2/core/cmd false 1.313333333s Unknown
TestShell_ListETHKeys 83.33% false false false 6 5 1 0 github.com/smartcontractkit/chainlink/v2/core/cmd false 1.258333333s Unknown
TestShell_ListETHKeys_Error 83.33% false false false 6 5 1 0 github.com/smartcontractkit/chainlink/v2/core/cmd false 1.245s Unknown

bolekk
bolekk previously approved these changes Dec 10, 2024
@@ -45,14 +42,15 @@ func NewLoopRegistry(lggr logger.Logger, tracing config.Tracing, telemetry confi
}
}

// Register creates a port of the plugin. It is not idempotent. Duplicate calls to Register will return [ErrExists]
// Register creates a port of the plugin. It is idempotent. Duplicate calls to Register will return the same port.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any possible unintended consequences?
Also why would anybody call it more than once?

if _, exists := m.registry[id]; exists {
return nil, ErrExists
if l, exists := m.registry[id]; exists {
m.lggr.Warnf("Trying to register a loop that is already registered %q", id)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmmmm -- is this all we need to do? I would have thought that there would now be multiple loopps running, one of which is orhpaned because I don't see us cleaning it up.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i believe it was a little different.

we are passing the loop server backas one of the job ServiceCtx objects and that will be closed when the active job closes all it's subservices

rather, we are forgetting to unregister the loop as part of this job close'ing

i refactored to make a much more targeted fix that only applies to mercury and a follow up ticket to make the pattern reusable for other jobs.

note that the generic jobs are already unregisteringand this should only effect job that really on custom providers

// loopUnregisterCloser is a helper to unregister a loop
// as a service
// TODO BCF-3451 all other jobs that use custom plugin providers that should be refactored to use this pattern
// perhaps it can be implemented in the delegate on job delete.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

@krehermann krehermann requested a review from samsondav December 10, 2024 18:22
@krehermann krehermann added this pull request to the merge queue Dec 12, 2024
Merged via the queue into develop with commit eaeb2eb Dec 12, 2024
169 of 170 checks passed
@krehermann krehermann deleted the ks-616/update-asset-don-jobs branch December 12, 2024 18:10
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.

6 participants