Conversation
|
@greptileai review pls |
Greptile SummaryThis PR fixes a bug where streams reserved via
Confidence Score: 5/5Safe to merge — the fix is small, targeted, and consistent with the existing stream-failure pattern. The change adds two lines that mirror the already-tested _fail_all_streams pattern. Pending streams have no assigned stream ID, so they are by definition never processed by the server; failing them on GOAWAY is always correct. The iteration is safe under _write_lock, _fail_stream is idempotent, and send_headers already checks state.error before promoting a pending stream, so the error surfaces cleanly to callers. No files require special attention. Important Files Changed
Sequence DiagramsequenceDiagram
participant Caller
participant Connection
participant H2
Caller->>Connection: reserve_stream()
Connection-->>Caller: state (added to _pending_streams)
note over Connection,H2: GOAWAY received before send_headers()
H2-->>Connection: "ConnectionTerminated (last_stream_id=N)"
Connection->>Connection: _handle_event()
alt last_stream_id is not None
loop "_streams where stream_id > N"
Connection->>Connection: _fail_stream(state, err)
end
loop _pending_streams (NEW in this PR)
Connection->>Connection: _fail_stream(state, err)
end
else last_stream_id is None
Connection->>Connection: _fail_all_streams(err)
end
Caller->>Connection: send_headers(state, ...)
Connection-->>Caller: raises state.error (ProtocolError)
Reviews (2): Last reviewed commit: "initial commit" | Re-trigger Greptile |
closes #44