A relay that pings and never reads no longer holds req and fetch - #27
Merged
Merged
Conversation
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.
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.
Closes #26.
A relay that sent pings after it had stopped reading held
reqandfetchpast--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 deadlinequeries 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.publishwas already safe, because it stops a relay's reader before waiting on its sends.