pkg/capabilities: support replacing registered capabilities after shutdown#1639
Merged
pkg/capabilities: support replacing registered capabilities after shutdown#1639
Conversation
jmank88
commented
Oct 22, 2025
✅ API Diff Results - No breaking changes |
bb7ad59 to
940dec7
Compare
Contributor
Author
|
Looks like this approach would require updating some generated code |
940dec7 to
95c48cb
Compare
95c48cb to
6d0215e
Compare
6d0215e to
2df6298
Compare
2df6298 to
298c913
Compare
298c913 to
944e37b
Compare
793d471 to
8913a12
Compare
8913a12 to
a5bf77b
Compare
a5bf77b to
d7dec7a
Compare
jmank88
commented
Oct 28, 2025
| bc, ok := r.m[id] | ||
| if ok { | ||
| switch state := bc.GetState(); state { | ||
| case connectivity.Shutdown, connectivity.TransientFailure: |
Contributor
Author
There was a problem hiding this comment.
Transient is actually fatal in our case, since the plugin cannot be redialed with the same ID.
jmank88
commented
Oct 28, 2025
jmank88
commented
Oct 29, 2025
| return nil, nil, fmt.Errorf("expected StandardCapabilities but got %T", instance) | ||
| } | ||
| return scs, scs, scs.Reinitialise(ctx) | ||
| return scs, scs, nil |
Contributor
Author
There was a problem hiding this comment.
This func is only called once, but we can just move this to the GRPCClient method instead.
d7dec7a to
ea1c06b
Compare
jmank88
commented
Oct 29, 2025
Comment on lines
+68
to
+69
| c.CloseAll(c.resources...) | ||
| c.resources = nil |
Contributor
Author
There was a problem hiding this comment.
This resource cleanup includes any created oracles
ea1c06b to
ee68518
Compare
jmank88
commented
Oct 29, 2025
Comment on lines
+166
to
+167
| case connectivity.Shutdown, connectivity.TransientFailure, connectivity.Idle: | ||
| // allow replace |
Contributor
Author
There was a problem hiding this comment.
I didn't want to include Idle here, but it is apparently necessary.
pavel-raykov
approved these changes
Oct 29, 2025
krehermann
reviewed
Oct 29, 2025
| if c == nil { | ||
| return connectivity.Shutdown | ||
| } | ||
| if sg, ok := (*c).(StateGetter); ok { |
Contributor
There was a problem hiding this comment.
why do we need the type cast check here but not on 252, 260?
krehermann
approved these changes
Oct 29, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
https://smartcontract-it.atlassian.net/browse/CRE-1126
Supports: