Repository navigation
release: 0.27.637 - #637
Merged
Merged
Conversation
All twelve csproj Version elements, 0.26.563 to 0.27.637. Carries the 24 PRs from #564 to #636. Package validation against 0.26.563 finds breaks in ioxide alone: Ring.Dispose(bool), Ring.SqPending, Native.IORING_REGISTER_SYNC_CANCEL and Native.io_uring_sync_cancel_reg are removed. The other ten published packages are clean. Suites on this tree: Unit 306, E2E 797, Http 113, Chaos 105, File 14, Tls 269 (kTLS included), Pg 10 (19 skipped, no server here), Redis 1 (7 skipped and 1 pending, no server here).
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.
All eleven published packages share one version, as always.
Versionelements;IoxideRuntime.Versionis generated fromioxide.csproj.ioxide.redis.stackexchangeis bumped too, so a manual pack matches, but CI does not pack it.Against 0.26.563, this carries the 24 PRs from #564 to #636.
Fixes
/dev/nullno child inherits, so a host retrying a failed start no longer keeps a ring per attempt.ReadFileAsyncreads behind a head that spilled underSegmented, is refused during a flush and for a length past the write buffer, and returns -EPIPE (-32) once the connection has closed.InitialWindowSizeand at most 65,535 bytes, instead of once per DATA frame.content-length, or whosecontent-lengthis not digits or comes twice, is reset with PROTOCOL_ERROR (RFC 9113 8.1.1) instead of being served.HasBodysays whether a body follows the HEADERS that opened the stream, whatevercontent-lengthsays, so a host need not guess.Http2ResponseWriter.ResetStreamAsyncends a response with RST_STREAM, INTERNAL_ERROR unless told otherwise, so a handler need not throw to do it. A handler's fault reachesHttp2Options.OnHandlerFault, when one is set, instead of stderr.RunAsyncbegun off the reactor still makes its first read only once its SETTINGS are out, as in 0.26.563, so a request already in is served on the reactor. http2: the connection's receive window opens to 2^31-1 and each stream's is enforced, so a connection's request bodies in flight are its streams times their window (#569) #593 had it read on behind that flush.HasBody, as on HTTP/2.QuicConnection.StopReading, so the client stops sending the rest and keeps the response.Nghttp3ResponseWriter.ResetStreamAsyncends a response with RESET_STREAM and STOP_SENDING, H3_INTERNAL_ERROR unless told otherwise. A handler's fault reachesNghttp3Options.OnHandlerFault, when one is set, instead of stderr.Writeno longer holds the reactor: 1 MiB took 8.2 s, and now takes 0.3 ms.content-lengthmust be digits, so10\0is no longer served as 10.Close,ResetStreamandStopReadingrefuse an application error code past 2^62 - 1 withArgumentOutOfRangeException, where ngtcp2's assertion aborted the process.HttpClientPool,RingHttpClient,PgPooland theAssetReaderpool close their idle connections, free what they hold and fail the requests waiting on them, so one waiting out a reconnect backoff (httpclient: a request waiting behind HttpClientPool's reconnect backoff is never ended once its reactor stops #584), or queued behind a connection handed over at the stop (httpclient: a connection handed to a waiting request in the pass where its reactor stops is never closed, and the requests behind it wait forever #610), no longer waits forever.TlsClientContextis refused and closes its socket, instead of callingSSL_newon the freed context (httpclient: RingHttpClient.Dispose frees its TLS context while a pool may still be connecting, and that connect then calls SSL_new on the freed context #611). A pg connect, or a redis.stackexchange reconnect, refused by a stopping reactor leaves no socket open.MaxResponseBytes, its trailers, chunk-size lines and 1xx heads included.Defaults
MaxConcurrentStreamsis 100, not 1000, andInitialWindowSize256 KiB, not 1 MiB, ioxide's QUIC stream window.Performance
Tests and docs
API
Package validation against 0.26.563 finds breaks in
ioxidealone; the other ten packages are clean. As a control,ioxideagainst 0.24.444 reports 48.ioxide. Nothing in the repo used them but the reactor code these PRs replaced:Ring.Dispose(bool)(reactor: a start that fails frees its ring, and keeps only its number, on /dev/null (#573) #576).Dispose()stays; a failed start's teardown uses an internal method that keeps the ring's number.Ring.SqPending,Native.IORING_REGISTER_SYNC_CANCELandNative.io_uring_sync_cancel_reg(reactor: a stop closes every connection and cancels every ring op, runs on until they have been let go or a second has passed, and then frees what nothing holds (#634) #636), since the stop no longer cancels synchronously.ioxide:Reactor.AddStopper(Action)andRingPool<T>asIDisposable(reactor: a stop closes every connection and cancels every ring op, runs on until they have been let go or a second has passed, and then frees what nothing holds (#634) #636),QuicConnection.StopReading(long, ulong)(http2, nghttp3: a response that ends before its request asks the client to stop sending the rest (#571) #582).ioxide.pg:PgPoolasIDisposable(reactor: a stop closes every connection and cancels every ring op, runs on until they have been let go or a second has passed, and then frees what nothing holds (#634) #636).ioxide.http2:Http2Request.HasBody(http2, nghttp3, http3: a request says whether a body follows its HEADERS, so a host need not guess from content-length (#570) #577);Http2ResponseWriter.ResetStreamAsync(uint),Http2ErrorCodeandHttp2Options.OnHandlerFault(http2, nghttp3: a handler resets its stream with ResetStreamAsync instead of throwing, and its faults reach OnHandlerFault instead of stderr (#572) #579).ioxide.nghttp2:Nghttp2Request.HasBody(nghttp2: a request says whether a body follows its HEADERS, so a host need not guess from content-length (#581) #594).ioxide.http3:Http3Request.HasBody(http2, nghttp3, http3: a request says whether a body follows its HEADERS, so a host need not guess from content-length (#570) #577).ioxide.nghttp3:Nghttp3Request.HasBody(http2, nghttp3, http3: a request says whether a body follows its HEADERS, so a host need not guess from content-length (#570) #577);Nghttp3ResponseWriter.ResetStreamAsync(ulong),Nghttp3ErrorCodeandNghttp3Options.OnHandlerFault(http2, nghttp3: a handler resets its stream with ResetStreamAsync instead of throwing, and its faults reach OnHandlerFault instead of stderr (#572) #579).Behaviour changes (no compile error)
MaxConcurrentStreamsdefaults to 100, not 1000, andInitialWindowSizeto 256 KiB, not 1 MiB (http2: the connection's receive window opens to 2^31-1 and each stream's is enforced, so a connection's request bodies in flight are its streams times their window (#569) #593). A host that never set them gets the new values.Runreturns once every connection has been let go and every ring op has ended, or after a second, a fixed deadline. A handler busy elsewhere holds the stop up to it. Before,Runreturned at once.HttpClientPool,RingHttpClient,PgPoolandAssetReaderpool started on the reactor is disposed. A request waiting on one fails withObjectDisposedException.Stop()on, a ring op submitted on the reactor throwsObjectDisposedException, as one from another thread does.TcpConnection.ReadFileAsynccan throw it betweenStop()and the stop's first pass.RecvSlotsxRecvBufferSize, 128 MiB by default) stays with it. On a fault nothing is drained, so a connection still open stays allocated until the process exits, where the fault path freed those whose handler let go.OnDatagram. A buffer given back from another thread to a full queue is dropped, where it spun forever.OnReactorThreadis false andReactor.Currentis null.ReactorSwitch.YieldthrowsObjectDisposedExceptioninstead of never resuming, and aDisposeof an httpclient pool or client, or of a pg connection, made there is posted and dropped, where it ran inline (reactor: once it has stopped, neither the thread that ran it nor a new thread given that one's managed id is taken for the reactor's (#608) #622)./dev/nullat its ring's number, where the ring stayed open there (reactor: a start that fails frees its ring, and keeps only its number, on /dev/null (#573) #576).ReadFileAsync, tcp: ReadFileAsync reads behind a head that spilled under Segmented, is refused during a flush, and returns -EPIPE once the connection has closed (#566) #574):AdvanceWritethrowInvalidOperationExceptionduring a flush. A second read while one is in flight is refused before anything is sized, with its own message.ArgumentOutOfRangeExceptionfor a negativelen, or one that takes the write position pastint.MaxValue, andAdvanceWritethrows it past what was handed out.Segmented, a read the slab can't hold goes to a segment instead of growing the slab, andGetMemorythen throwsNotSupportedExceptionuntil the next flush. Nothing changes underGrow.IsCompletedand drops what is staged, and one afterCancelPendingFlushreportsIsCanceledtoo, as the kTLS half does. It used to wait forever (tls: a flush from another thread returns completed once the reactor has stopped, also one the stop found queued, instead of waiting forever (#568) #580).content-length, or whosecontent-lengthis not digits or is repeated, even with the same value, is reset with PROTOCOL_ERROR where it was served (http2: a request whose body does not match its content-length is reset with PROTOCOL_ERROR instead of being served (#567) #575).OnHandlerFaulton http2, and stderr on nghttp2, as aNullReferenceException(http2, nghttp3: a response that ends before its request asks the client to stop sending the rest (#571) #582, http2: a synchronous buffered handler that answers null gets a 500 on its own stream instead of ending the connection (#592) #603, nghttp2, nghttp3, http3: a buffered handler that answers null gets a 500 on its own stream instead of ending the connection or going unanswered (#616) #628).RunAsync's task no longer faults for it. The fault reachesOnHandlerFaulton nghttp3, and stderr on http3 (nghttp2, nghttp3, http3: a buffered handler that answers null gets a 500 on its own stream instead of ending the connection or going unanswered (#616) #628).GetMemory()with no hint returns 16 KiB, not 16 bytes, andGetSpan()on a full block at least as much as the block holds. A block grown by staging without a flush can be up to twice what was staged in it (nghttp3: the streamed writer's staging block at least doubles as it grows, so one large Write no longer holds the reactor for seconds (#591) #602).content-lengthwith anything but digits makes the request malformed (http2: a request whose body does not match its content-length is reset with PROTOCOL_ERROR instead of being served (#567) #575).Close,ResetStreamandStopReadingon aQuicEngineConnectionthrowArgumentOutOfRangeExceptionfor a code above 2^62 - 1, even once the connection has closed. They used to abort the process, or do nothing once closed (ngtcp2: an application error code past 2^62 - 1 is refused with ArgumentOutOfRangeException instead of aborting the process (#586) #595).TaskCanceledExceptionaround aConnectionAbortedException. An app still writing seesRequestAbortedfire, and its writes are dropped.HttpClientPoolorRingHttpClientthrowsObjectDisposedException, where it threwHttpClientException, so a handler that catchesHttpClientExceptionto answer a 502 no longer catches it (reactor: a stop closes every connection and cancels every ring op, runs on until they have been let go or a second has passed, and then frees what nothing holds (#634) #636).MaxResponseBytescounts the whole response as it comes off the wire, so one whose body fits but whose head and chunk framing pass the limit now fails. A body framed by the close fails past it withresponse exceeds MaxResponseBytes(httpclient: every byte of an h1 response counts against MaxResponseBytes, so trailers, chunk extensions and 1xx heads can't run past it (#540) #564).Content-Lengthlists and oversized values are framed by their length (httpclient: an HTTP/1.0 response with Transfer-Encoding is refused as faulty framing, and its connection closed, rather than read as chunked (#541) #565).PgPoolorAssetReaderpool disposed by its reactor's stop fails a query or rent waiting on it, and any made after, withObjectDisposedException. A resource given back to a disposedRingPool<T>is disposed (reactor: a stop closes every connection and cancels every ring op, runs on until they have been let go or a second has passed, and then frees what nothing holds (#634) #636).For GenHTTP
GenHTTP's main still references 0.15.251 in its API, engine and files modules; its open pull request 953 moves them to 0.26.563. What 0.27.637 changes for that branch's code:
GenHTTP.Api.Ioxideand the files module build against this tree for net10.0 and net11.0 with warnings as errors, and call nothing that was removed or renamed.Server.DisposeAsyncstops every reactor, then joins each for 5 s.Runnow returns once a reactor's connections have been let go, a second at most, so inside the join. Their clients get a reset (a FIN under kTLS), and what was queued to them is dropped. A handler that finishes on another thread in that second resumes on the reactor at itsReactorSwitch, instead of gettingObjectDisposedException(reactor: a stop closes every connection and cancels every ring op, runs on until they have been let go or a second has passed, and then frees what nothing holds (#634) #636). Nothing to change.AssetReaderpoolIoxideAssetContent.RentPoolcreates is disposed by its reactor's stop, which frees its readers, and a rent waiting then or made after throwsObjectDisposedException(reactor: a stop closes every connection and cancels every ring op, runs on until they have been let go or a second has passed, and then frees what nothing holds (#634) #636). InHttp1FileSink,ReadFileAsyncreturns -32 for a client that left, whichread <= 0covers, and can throwObjectDisposedExceptionbetweenStop()and the stop's first pass (tcp: ReadFileAsync reads behind a head that spilled under Segmented, is refused during a flush, and returns -EPIPE once the connection has closed (#566) #574, reactor: a stop closes every connection and cancels every ring op, runs on until they have been let go or a second has passed, and then frees what nothing holds (#634) #636). Nothing to change.ConnectionClosedExceptionfromHttp1WriterStream, where the flush waited forever (tls: a flush from another thread returns completed once the reactor has stopped, also one the stop found queued, instead of waiting forever (#568) #580). Nothing to change.Http2Drivercreates itsHttp2Connectionwithout options, so its connections now advertiseMaxConcurrentStreams100 (was 1000) andInitialWindowSize256 KiB (was 1 MiB) (http2: the connection's receive window opens to 2^31-1 and each stream's is enforced, so a connection's request bodies in flight are its streams times their window (#569) #593).EngineOptionshas no HTTP/2 section to set them.HasBody:StreamedRequest.CheckForBodysees a body only where there is acontent-length.Http2Request.HasBodyandNghttp3Request.HasBodysay whether one follows the HEADERS, so with them an upload sent withoutcontent-lengthwould reach its handler (http2, nghttp3, http3: a request says whether a body follows its HEADERS, so a host need not guess from content-length (#570) #577). Optional.StreamedDriverrethrows so ioxide resets the stream. That still works, and with noOnHandlerFaultioxide still writes its own stderr line beside GenHTTP's log.ResetStreamAsyncon both writers andOnHandlerFaultonHttp2OptionsandNghttp3Options(http2, nghttp3: a handler resets its stream with ResetStreamAsync instead of throwing, and its faults reach OnHandlerFault instead of stderr (#572) #579) are what GenHTTP issue 984 asks for. Optional.StreamedSinkstages each write through the BCLWriteextension, which grew nghttp3's staging block a byte at a time past 16 KiB; it now at least doubles (nghttp3: the streamed writer's staging block at least doubles as it grows, so one large Write no longer holds the reactor for seconds (#591) #602). Nothing to change.Native
libioxide_nghttp2.so(#594, #635) andlibioxide_ngtcp2.so(#582) changed, rebuilt for x64 and arm64 with their shims. The ngtcp2 shim's ABI goes from 7 to 8 withiq_conn_shutdown_stream_read(#582). #635's nghttp2 libraries were rebuilt from the shim merged with #594's, so they carry both changes.libioxide_boringssl.soandlibioxide_nghttp3.soare unchanged.Testing
tlsmodule loaded, so the kTLS tests ran.