Apply the retry code to the async pubsub client#8503
Merged
steveluscher merged 2 commits intoanza-xyz:masterfrom Oct 20, 2025
Merged
Apply the retry code to the async pubsub client#8503steveluscher merged 2 commits intoanza-xyz:masterfrom
steveluscher merged 2 commits intoanza-xyz:masterfrom
Conversation
Create a test server
```ts
import http from "http";
import { WebSocketServer } from "ws";
let attemptCount = 0;
const server = http.createServer();
const wss = new WebSocketServer({ noServer: true });
wss.on("connection", (ws) => {
ws.send("Connection accepted.");
ws.on("message", (msg) => console.log(`Received: ${msg}`));
});
server.on("upgrade", (req, socket, head) => {
attemptCount += 1;
if (attemptCount <= 4) {
socket.write("HTTP/1.1 429 Too Many Requests\r\n\r\n");
socket.destroy();
console.log(`Rejected connection #${attemptCount} (429)`);
return;
}
wss.handleUpgrade(req, socket, head, (ws) => {
wss.emit("connection", ws, req);
console.log("Connection accepted on attempt", attemptCount);
});
});
server.listen(8080, () => {
console.log("Server listening on port 8080");
});
```
Run `test_slot_subscription_async`:
```
Rejected connection #1 (429)
Rejected connection #2 (429)
Rejected connection anza-xyz#3 (429)
Rejected connection anza-xyz#4 (429)
Connection accepted on attempt 5
Received: {"id":1,"jsonrpc":"2.0","method":"slotSubscribe","params":[]}
```
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #8503 +/- ##
========================================
Coverage 83.1% 83.1%
========================================
Files 840 840
Lines 367669 367698 +29
========================================
+ Hits 305719 305875 +156
+ Misses 61950 61823 -127 🚀 New features to boost your workflow:
|
joncinque
previously approved these changes
Oct 20, 2025
joncinque
left a comment
There was a problem hiding this comment.
Looks good to me! Just the nit on naming, which you can take or leave
Collaborator
|
😱 New commits were pushed while the automerge label was present. |
rustopian
pushed a commit
to rustopian/agave
that referenced
this pull request
Nov 20, 2025
* Apply the retry code to the async pubsub client
Create a test server
```ts
import http from "http";
import { WebSocketServer } from "ws";
let attemptCount = 0;
const server = http.createServer();
const wss = new WebSocketServer({ noServer: true });
wss.on("connection", (ws) => {
ws.send("Connection accepted.");
ws.on("message", (msg) => console.log(`Received: ${msg}`));
});
server.on("upgrade", (req, socket, head) => {
attemptCount += 1;
if (attemptCount <= 4) {
socket.write("HTTP/1.1 429 Too Many Requests\r\n\r\n");
socket.destroy();
console.log(`Rejected connection #${attemptCount} (429)`);
return;
}
wss.handleUpgrade(req, socket, head, (ws) => {
wss.emit("connection", ws, req);
console.log("Connection accepted on attempt", attemptCount);
});
});
server.listen(8080, () => {
console.log("Server listening on port 8080");
});
```
Run `test_slot_subscription_async`:
```
Rejected connection #1 (429)
Rejected connection #2 (429)
Rejected connection #3 (429)
Rejected connection #4 (429)
Connection accepted on attempt 5
Received: {"id":1,"jsonrpc":"2.0","method":"slotSubscribe","params":[]}
```
* `s/async_with_retry/with_retry/`
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.
Four years ago, retry was added to the sync client. Never to the async client.
UNTIL TODAY.
Test plan
Create a test server
Run
test_slot_subscription_async: