Skip to content

Test flake on macOS: sendmsg raises ENOTCONN, so an early capacity answer reads as unavailable #110

Description

@flavorjones

test_an_answer_that_arrives_before_the_request_is_sent_is_still_the_verdict failed once on the hotcell (macos, ruby 3.4) job in this run, on #109. The test is from #67. The same job passed on #109's previous and next pushes, which didn't change transport.rb.

The test has a cell answer capacity and close the connection before it reads the request. Transport::Socket#deliver ignores Errno::EPIPE and Errno::ECONNRESET from that send, so receive can read the answer. On this run, macOS raised Errno::ENOTCONN instead. deliver doesn't rescue it, so call reported unavailable and never read the capacity answer:

  1) Failure:
ClassificationTest#test_an_answer_that_arrives_before_the_request_is_sent_is_still_the_answer [test/classification_test.rb:273]:
unavailable: Errno::ENOTCONN: Socket is not connected - sendmsg(2).
Expected: "capacity"
  Actual: "unavailable"

116 runs, 370 assertions, 1 failures, 0 errors, 0 skips

(#109 renames the test; its master name is above, at classification_test.rb#L246.)

Proposal: rescue Errno::ENOTCONN in deliver alongside EPIPE and ECONNRESET, after confirming that macOS raises it from sendmsg when the peer has closed. The same race affects real calls on macOS: a full cell's capacity answer can arrive as unavailable. I haven't checked whether Linux can raise ENOTCONN here.

Activity

  1. added a commit that references this issue on Oct 10, 2026
    cb8df4a
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions