Skip to content

A relay that pings and never reads no longer holds req and fetch - #27

Merged
sepehr-safari merged 1 commit into
mainfrom
req-outlasts-a-ping-flood
Sep 24, 2026
Merged

sepehr-safari merged 1 commit into
mainfrom
req-outlasts-a-ping-flood

Conversation

@sepehr-safari

Copy link
Copy Markdown
Contributor

Closes #26.

A relay that sent pings after it had stopped reading held req and fetch past --timeout: the pong written in answer filled a socket it never read, and the write waited forever inside the read. nostr 0.14.7 (zig-nostr/nostr#121) bounds that write by the read's deadline, so this moves the pin to it.

a relay that pings and never reads does not hold the run past its deadline queries such a relay beside a live one and requires the run to finish, with the live relay's EOSE counted. With the pin put back to 0.14.6 the test hangs. All 95 tests pass. publish was already safe, because it stops a relay's reader before waiting on its sends.

Answering the pings of a relay that had stopped reading filled a socket it never read, and the pong write waited forever inside the read, past --timeout. nostr 0.14.7 bounds that write by the read's deadline, so the pin moves to it. A test runs a query against such a relay beside a live one and requires it to finish; on 0.14.6 it hangs.

Closes #26.
@sepehr-safari
sepehr-safari merged commit 6675dc1 into main Sep 24, 2026
2 checks passed
@sepehr-safari
sepehr-safari deleted the req-outlasts-a-ping-flood branch September 24, 2026 08:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

A relay that sends pings and stops reading holds req and fetch

1 participant