-
Notifications
You must be signed in to change notification settings - Fork 204
cache listeners on routing stage for later use #4599
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
cache listeners on routing stage for later use #4599
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #4599 +/- ##
==========================================
+ Coverage 30.82% 30.85% +0.02%
==========================================
Files 221 221
Lines 25947 25947
==========================================
+ Hits 7999 8005 +6
+ Misses 17297 17291 -6
Partials 651 651 ☔ View full report in Codecov by Sentry. |
pkg/app/piped/executor/ecs/ecs.go
Outdated
| for i, v := range currListenerArns { | ||
| metadataListeners[fmt.Sprintf(currentListenersKey+"-%d", i)] = v | ||
| } | ||
| if err := in.MetadataStore.Shared().PutMulti(ctx, metadataListeners); err != 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.
This only stores the listeners to metadata store, I think we have to add logic for query that data from store before fetch using API (client) at L419 👀
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.
Thanks!
I added it. get listeners from cache
44882e2 to
730d6e9
Compare
ffjlabo
left a comment
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.
Thank you so much for your contribution! 🥇
It's totally OK! I just commented on one nit point!
| // Store created listeners to use later. | ||
| addedListeners := make([]string, 0, len(currListenerArns)) | ||
| addedListeners = append(addedListeners, currListenerArns...) | ||
| metadata := strings.Join(addedListeners, ",") | ||
| if err := in.MetadataStore.Shared().Put(ctx, currentListenersKey, metadata); err != nil { | ||
| in.LogPersister.Errorf("Unable to store created listeners to metadata store: %v", err) | ||
| return false | ||
| } |
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.
[nits]
Are these values of addedListeners the same as currListenerArns ?
If so, it might be better just to use currListenerArns to store as metadata 👀
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.
Thank you! I fixed it. use currListenerArns instead of addedListeners
|
/review |
PR AnalysisMain themetype: Enhancement PR summarytype: string Type of PRRefactoring PR Feedback:General suggestionstype: string
Code feedbacktype: array relevant line: Security concerns:type: string |
2e77e94 to
87433db
Compare
ffjlabo
left a comment
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.
Thank you for your contribution 🚀
3ef3dad to
366b0ba
Compare
Signed-off-by: nnnkkk7 <[email protected]>
Signed-off-by: nnnkkk7 <[email protected]>
Signed-off-by: nnnkkk7 <[email protected]>
366b0ba to
4e86b6e
Compare
|
Let's me hold this PR until PR #4688 merged 🙏 |
khanhtc1202
left a comment
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.
🚀 🚀 🚀
* cache current listeners for later use Signed-off-by: nnnkkk7 <[email protected]> * get listeners from cache Signed-off-by: nnnkkk7 <[email protected]> * use currListenerArns instead of addedListeners Signed-off-by: nnnkkk7 <[email protected]> --------- Signed-off-by: nnnkkk7 <[email protected]>
* cache current listeners for later use Signed-off-by: nnnkkk7 <[email protected]> * get listeners from cache Signed-off-by: nnnkkk7 <[email protected]> * use currListenerArns instead of addedListeners Signed-off-by: nnnkkk7 <[email protected]> --------- Signed-off-by: nnnkkk7 <[email protected]>
* cache current listeners for later use Signed-off-by: nnnkkk7 <[email protected]> * get listeners from cache Signed-off-by: nnnkkk7 <[email protected]> * use currListenerArns instead of addedListeners Signed-off-by: nnnkkk7 <[email protected]> --------- Signed-off-by: nnnkkk7 <[email protected]> Signed-off-by: sZma5a <[email protected]>
* cache current listeners for later use Signed-off-by: nnnkkk7 <[email protected]> * get listeners from cache Signed-off-by: nnnkkk7 <[email protected]> * use currListenerArns instead of addedListeners Signed-off-by: nnnkkk7 <[email protected]> --------- Signed-off-by: nnnkkk7 <[email protected]> Signed-off-by: 鈴木 優耀 <[email protected]>
What this PR does / why we need it:
Which issue(s) this PR fixes:
Fixes #4474
Does this PR introduce a user-facing change?: