Skip to content

Preserve hooked stream timeout failures - #6236

Open
binaryfire wants to merge 1 commit into
swoole:6.1from
binaryfire:fix/stream-timeout-results
Open

binaryfire wants to merge 1 commit into
swoole:6.1from
binaryfire:fix/stream-timeout-results

Conversation

@binaryfire

Copy link
Copy Markdown
Contributor

Native PHP returns false when a blocking stream read or write times out without transferring data. The coroutine stream hook converted these failures into zero-byte results, so fread() returned an empty string and fwrite() returned 0.

Keep timeout failures as errors while preserving the existing nonblocking, EOF, and partial-I/O behavior.

The read regression tightens the existing timeout test. The write regression fills a local socket pair, then verifies the blocking timeout returns false without marking the stream as EOF.

Native PHP reports blocking read and write timeouts as failed stream operations. Keep ETIMEDOUT negative in the coroutine stream adapter so fread() and fwrite() return false without marking the stream as EOF.
@codecov

codecov Bot commented Sep 12, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 86.24%. Comparing base (07606e5) to head (53120fb).

Additional details and impacted files
@@            Coverage Diff             @@
##              6.1    #6236      +/-   ##
==========================================
- Coverage   86.24%   86.24%   -0.01%     
==========================================
  Files         110      110              
  Lines       16790    16790              
  Branches     2980     2980              
==========================================
- Hits        14481    14480       -1     
- Misses       2309     2310       +1     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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.

1 participant