ruby / ruby/net-http

Response to interrupted request returned for next one, after timeout interrupts reading the socket

Open
#157 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Ruby
Stars
148
Forks
95
Avg merge
10h 54m
Merged PRs (30d)
4

Description

In ruby-3.2.2/lib/ruby/3.2.0/net/http.rb line 1855, a request is written to the socket; on line 1862 the response is read from the socket.

However, if a Timeout::Error occurs before the response arrives, the response is not read from the socket.

If the client is re-used, this causes the next request to read the response from the interrupted request (since it's queued on the socket and nothing else has read it).

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in ruby-3.2.2/lib/ruby/3.2.0/net/http.rb around lines 1855-1862, where the request is written and the response is read. Reproduce a Timeout::Error before the response arrives, reuse the client, and verify that the next request no longer receives the interrupted request's response.

Written by the indexing model from the issue text.

Assessment

Tech stack
ruby
Domain
networking
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.