-
Notifications
You must be signed in to change notification settings - Fork 410
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
feat: add the # of messages prioritized in the queue to the http resp… #5043
Conversation
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #5043 +/- ##
=======================================
Coverage 77.53% 77.53%
=======================================
Files 103 103
Lines 2110 2110
Branches 190 190
=======================================
Hits 1636 1636
Misses 453 453
Partials 21 21
|
e234faf
to
b35d465
Compare
b35d465
to
cf9c2c4
Compare
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.
good stuff!
excited that this task is fairly meaty, lots of interesting concurrency and touching a lot of systemic things in the relayer :)
- also updating tracing calls to use structured logs - update variable names to receiver/transmitter instead of rx/tx
- this creates a nice separation between each retry request and won't cause multiple requests to conflict with each others responses
e23f01a
to
491f981
Compare
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.
😎 awesome work, hitting the ground running from the first PR!!
- add more logging - move test code into helper functions
- log matched request uuids
- update test cases to (1, 1) - add error handling - panic if failed to send retry request
🙏 go @kamiyaa! You need to fix clippy for CI to pass btw: |
Ah, let me do that before merging! |
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.
mostly stylistic nits but I think the reading responses is prone to a race condition
- fix nits - add comments to functions - remove thread::spawn
if retry_req.pattern.op_matches(&op) { | ||
debug!(uuid = retry_req.uuid, "Matched request"); | ||
retry_response.matched += 1; | ||
Some(retry_req.uuid.clone()) |
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.
seems like this isn't used anymore? think we can go back to using .any
instead of filter_map
and avoid this allocation
|
||
// This channel is only created to service this single | ||
// retry request so we're expecting a single response | ||
// from each transmitter end, hence we are using a channel of size 1 |
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.
nit: comment is stale
hyperlane-xyz#5043) ### Description Add a mpsc channel between relayer and message retry handler, so message retry handler knows the retry results from the relayer. `POST /message_retry` endpoint now returns a JSON with details on the retry request: ```rust #[derive(Clone, Debug, Deserialize, Serialize)] pub struct MessageRetryResponse { /// ID of the retry request pub uuid: String, /// how many pending operations were processed pub processed: usize, /// how many of the pending operations matched the retry request pattern pub matched: u64, } ``` ### Drive-by changes <!-- Are there any minor or drive-by changes also included? --> ### Related issues Fixes hyperlane-xyz#4059 ### Backward compatibility <!-- Are these changes backward compatible? Are there any infrastructure implications, e.g. changes that would prohibit deploying older commits using this infra tooling? Yes/No --> ### Testing Updated unit tests to return a response so the handler is not blocked
hyperlane-xyz#5043) ### Description Add a mpsc channel between relayer and message retry handler, so message retry handler knows the retry results from the relayer. `POST /message_retry` endpoint now returns a JSON with details on the retry request: ```rust #[derive(Clone, Debug, Deserialize, Serialize)] pub struct MessageRetryResponse { /// ID of the retry request pub uuid: String, /// how many pending operations were processed pub processed: usize, /// how many of the pending operations matched the retry request pattern pub matched: u64, } ``` ### Drive-by changes <!-- Are there any minor or drive-by changes also included? --> ### Related issues Fixes hyperlane-xyz#4059 ### Backward compatibility <!-- Are these changes backward compatible? Are there any infrastructure implications, e.g. changes that would prohibit deploying older commits using this infra tooling? Yes/No --> ### Testing Updated unit tests to return a response so the handler is not blocked
Description
Add a mpsc channel between relayer and message retry handler, so message retry handler knows the retry results from the relayer.
POST /message_retry
endpoint now returns a JSON with details on the retry request:Drive-by changes
Related issues
Fixes #4059
Backward compatibility
Testing
Updated unit tests to return a response so the handler is not blocked