Fix portable error handling on native Windows - #192
Draft
binaryfire wants to merge 5 commits into
Draft
Conversation
Compare coroutine server failures against Swoole's normalized errno domain so native Windows timeouts and resource limits take the intended paths. Return false with the socket error on fatal accept failures, and leave the running flag false after every start result. Add focused coverage for timeout retries, cancellation, setup failures, and fatal errors.
Use Swoole's normalized connection-reset and protocol error values when FastCGI packet reads fail. Cover empty and malformed packets with constructed socket doubles that exercise the public client workflow without opening a connection.
Set the coroutine socket's public error code from Swoole's errno family when a zero-length compatibility receive is rejected. Exercise the branch with a real datagram coroutine socket so the published value stays tied to the runtime error domain.
Document the native Windows error-domain correction and the accurate coroutine server start result in the Unreleased section.
Attach the pull request number and contributor credit to the Unreleased error-handling entry now that GitHub has assigned it.
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.
Swoole normalizes native Windows socket failures into its portable errno domain. PHP's
SOCKET_E*constants use Winsock values there, so the library can miss timeouts, resource limits, and packet errors.This switches the coroutine server, FastCGI client, and sockets compatibility functions to
SWOOLE_ERRNO_E*. It also makesCoroutine\Server::start()return false with the socket error after a fatal accept failure and leave its lifecycle state consistent.The tests cover the affected public paths.
This depends on swoole-src#6152 and must not merge until its release version is known and the Composer minimum is updated.