-
Notifications
You must be signed in to change notification settings - Fork 402
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(shuttle): Parametrize hub connection timeouts for HubSubscriber & MessageReconciliation #2367
Conversation
…and MessageReconciliation
🦋 Changeset detectedLatest commit: 7d66f04 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2367 +/- ##
===========================================
- Coverage 74.05% 34.96% -39.10%
===========================================
Files 99 146 +47
Lines 9425 26201 +16776
Branches 2097 9297 +7200
===========================================
+ Hits 6980 9162 +2182
- Misses 2327 14675 +12348
- Partials 118 2364 +2246 ☔ View full report in Codecov by Sentry. |
@@ -767,7 +767,7 @@ describe("shuttle", () => { | |||
}; | |||
|
|||
// Only include 2 of the 3 messages in the time window | |||
const reconciler = new MessageReconciliation(mockRPCClient as unknown as HubRpcClient, db, log); | |||
const reconciler = new MessageReconciliation(mockRPCClient as unknown as HubRpcClient, db, log, 500); |
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.
I would make this a few ms shorter (or the timeout above longer) so we don't have flaky tests
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.
Fixed
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
…riber Follow-up to farcasterxyz#2367. Missed piping through BaseHubSubscriber's new `connectionTimeout` param through to EventStreamHubSubscriber.
…riber Follow-up to farcasterxyz#2367. Missed piping through BaseHubSubscribers new `connectionTimeout` param through to EventStreamHubSubscriber.
…riber (#2382) ## Why is this change needed? Follow-up to #2367. I missed piping through BaseHubSubscriber's new `connectionTimeout` param through to EventStreamHubSubscriber, which means `connectionTimeout` isn't really configurable for streaming right now like it should be. ## Merge Checklist _Choose all relevant options below by adding an `x` now or at any time before submitting for review_ - [x] PR title adheres to the [conventional commits](https://www.conventionalcommits.org/en/v1.0.0/) standard - [x] PR has a [changeset](https://github.com/farcasterxyz/hub-monorepo/blob/main/CONTRIBUTING.md#35-adding-changesets) - [ ] PR has been tagged with a change label(s) (i.e. documentation, feature, bugfix, or chore) - [x] PR includes [documentation](https://github.com/farcasterxyz/hub-monorepo/blob/main/CONTRIBUTING.md#32-writing-docs) if necessary. <!-- start pr-codex --> --- ## PR-Codex overview This PR focuses on adding a new optional parameter, `connectionTimeout`, to the `EventStreamHubSubscriber` class, allowing for better control over connection timeouts. ### Detailed summary - Added `connectionTimeout?: number` as an optional parameter in the constructor of `EventStreamHubSubscriber`. - Updated the call to `super` in the constructor to include the new `connectionTimeout` argument. > ✨ Ask PR-Codex anything about this PR by commenting with `/codex {your question}` <!-- end pr-codex -->
Why is this change needed?
Running the latest version of Shuttle with its fixed 5000ms hub connection timeout for reconciliation has resulted in a lot of timeout failures even against a seemingly healthy hub. I've increased the default connection timeout of MessageReconciliation from 5000ms to 30000ms to match HubSubscriber's and parameterized both.
Merge Checklist
Choose all relevant options below by adding an
x
now or at any time before submitting for reviewPR-Codex overview
This PR introduces parameterized connection timeouts for the
HubSubscriber
andMessageReconciliation
classes, allowing for more flexible timeout settings in handling unresponsive connections.Detailed summary
connectionTimeout
parameter to the constructors ofMessageReconciliation
andBaseHubSubscriber
, defaulting to 30000 milliseconds.MessageReconciliation
to useconnectionTimeout
.