Motivation:
We added a couple of shims which were upstreamed to swift-nio and were
released in 2.82.0.
Modifications:
- Bump minimum verison of swift-nio
- Remove shims
Result:
Less code
Motivation:
Swift 6.1 has been released, we should add it to our CI coverage.
Modifications:
Add additional Swift 6.1 jobs where appropriate in main.yml,
pull_request.yml
Result:
Improved test coverage.
### Motivation:
To remove all uses of the older workflow so it can be removed to
simplify the workflows.
### Modifications:
* Switch h2Spec tests to use the newer Swift test matrix workflow,
`swift_test_matrix.yml`
### Result:
This should make no difference to the running of h2Spec tests.
Motivation:
* Improve test coverage
Modifications:
Enable macOS CI to be run on pull request commits and make the use of
the nightly runner pool for main.yml jobs explicit.
Result:
Improved test coverage.
Motivation:
The HTTP2StreamMultiplexer isn't `Sendable`, but it has public API for
creating streams which must operate from off of the `EventLoop`.
Modifications:
- Add a `SendableView` over the multiplexer which only provides the
methods for creating streams. These are safe to call from any isolation
domain.
Result:
Can create streams from off of the EL.
Motivation:
To increase concurrency safety the NIOHTTP2 module should compile
without warning under strict concurrency checking.
Modifications:
- Add a few temporary internal helpers
- Annotate the pipeline helpers
Result:
Fewer concurrency warnings
Co-authored-by: Rick Newton-Rogers <rnro@apple.com>
Enable macOS CI on merge to main and daily timer
### Motivation:
* Improve test coverage
* Check test pass/fail status
* Monitor CI throughput
### Modifications:
Enable macOS CI to be run on all merges to main and on a daily timer.
### Result:
Improved test coverage run out-of-band at the moment so we can get a
feeling for if any changes need to be made in the repo or in the CI
pipelines to ensure timely and stable checks.
Motivation:
To increase concurrency safety the NIOPHACK module should compile
without warning under strict concurrency checking.
Modifications:
- Add explicit Sendable annotations
Result:
No concurrency warnings.
Update main.yml integration tests to use `swift_test_matrix` as has been
done on the PR workflow. This brings it off the deprecated workflow and
should fix the nightly-6.1 issue
Motivation:
The maximum number of recently reset stream frames to track is limited
to a fixed value of 32. This should be configurable.
Modifications:
- Add it to the connection config and propagate it through
Result:
- Resolves#493
Motivation:
When the server is in the locally quiescing state and a client attempts
to open a new stream, the connection state machine treats receiving the
headers as a connection error. This results in the connection being
closed and in-flight requests being failed.
This can happen because of the inherent race between the server sending
a GOAWAY frame and the client receiving it, during which time the client
can open a stream not knowing it's doomed to failure.
Rather than the server treating this as a connection error, it should
reject the stream with a RST_STREAM frame and emit a stream error.
Modifications:
- Emit a stream error when receiving HEADERS in the locally quiesced
state
Result:
Better handling of new streams when the server is quiescing
Strictly speaking, a `close` operation can't really fail (except when
the closing mode isn't supported or the channel is already closed). Even
if an error is encountered while closing a channel, or if an error
caused the channel to be closed, the end result is the same: the channel
will be closed.
In this case in particular, when streams are closed from the client
(i.e. by sending a RST_STREAM frame) the `HTTP2StreamChannel` would fail
the channel's `closeFuture`. This isn't appropriate however, as the
channel is successfully closed.
This change stops failing the stream channel's `closeFuture`. Instead,
if the close happens uncleanly, the error will be fired down the
pipeline and the `close` method's promise will be failed.
Enable MemberImportVisibility check on all targets. Use a standard
string header and footer to bracket the new block for ease of updating
in the future with scripts.
## Motivation
Currently, the multiplexer's inbound streams stream is finished only
when the channel becomes inactive.
There are some scenarios in which the channel may be closed before it
has a chance to become active, and the stream will never be finished.
This can cause any users iterating over the stream to hang.
## Modifications
This PR finishes the inbound streams stream when a connection error is
fired, and when the handler is removed.
## Result
Fewer bugs.
In the async HTTP2 pipeline there is no way to account for the opening
and closing of streams. This PR adds a variant of
`configureAsyncHTTPServerPipeline` (HTTP2 upgrade channel) that allows
the user to pass in a `NIOHTTP2StreamDelegate` to be applied to the
HTTP2 channel if the upgrade occurs.
This is similar to #439 which did the same HTTP2 only channels.
I added the `Bionic` import this summer in #448 and the compiler
accepted it then, but it started erroring a couple months later without
this full Android overlay, so add that instead.
Motivation:
Complete enablement of all standard GitHub Actions workflows.
Modifications:
Describe the modifications you've done.
Result:
After your change, what will change.
Motivation:
Testing is good - we should check results on PRs.
Modifications:
Add integration tests to PR and scheduled GitHub Actions workflows.
Result:
Integration tests run.
Motivation:
More testing is better.
Modifications:
Setup github actions to run http/2 spec tests.
Result:
Testing against http/2 spec occurs on pull requests
Motivation:
Standardised formatting makes the project cleaner to look at and work
on.
Modifications:
Setup swift-format with the same settings as Swift-NIO
Result:
Common formatting throughout
Motivation:
NIO is getting stricter concurrency annotations.
This is breaking this project, allow warnings until things settle.
Modifications:
Alter CI flags to allow warnings.
Result:
CI will continue to work for now.
Motivation:
Only the last 3 versions of Swift are supported.
Modifications:
Update the Swift tools version in Package.swift.
Remove code which can now never be compiled.
Remove legacy docker configuration.
Result:
Only Swift 5.9+ supported.
Motivation:
Want to move away from legacy CI.
Modifications:
Add configuration and update code to use GitHub actions.
Result:
GitHub Actions can be used for basic CI.
Motivation:
We're no longer maintaining this list as it can be trivially obtained
from git history.
Modifications:
Remove script for generating contributors list.
Result:
One less script to maintain
Motivation:
It's hard to keep track of all the pieces that do multiplexing. When
making some changes I found myself writing down what each piece did and
how they fit together. I think this is generally useful information for
anyone maintaining the library.
Modifications:
- Add a DocC article about the different multiplexing approaches that's
aimed at _maintainers_ of NIOHTTP2.
Result:
Easier to learn about how multiplexing is done
---------
Co-authored-by: Cory Benfield <lukasa@apple.com>
Motivation:
NIO has a 'ChannelShouldQuiesceEvent' which channels can listen for in
order to know when they should quiesce. This is typically used to
initiate a graceful shutdown of an HTTP/2 server. However, child
channels aren't notified of this event so HTTP/2 servers must keep track
of streams separately in order to notify them when the server is
quiescing.
Modifications:
- Propagate the `ChannelShouldQuiesceEvent` to child channels
Result:
Child channels can watch for `ChannelShouldQuiesceEvent`s
Motivation:
A potential race exists between a server sending a GOAWAY frame and a
client opening a new stream (i.e., sending a HEADERS frame before
receiving an already sent GOAWAY frame). If there are no open streams
when the server sends the GOAWAY frame, the connection state on the
server transitions to being fully quiesced, which throws a connection
error on receipt of a HEADERS frame.
Modifications:
- Adjust the connection state machine on the server to throw a stream
error (instead of a connection error), and consequently, send a
RST_STREAM frame to the client.
Result:
This condition will be treated as a stream-level error instead.
Motivation:
When the connection is fully quiesced, an endpoint responds with a
connection error when it receives or tries to respond to a PING frame.
This behaviour is unnecessary.
Modifications:
- Adjust `HTTP2ConnectionStateMachine` to successfully receive and send
PING frames even when the connection is fully quiesced.
Result:
When the connection is fully quiesced, an endpoint will treat receipt
and sending of a PING frame as it would when the connection is active.
Motivation:
Building swift-nio-http2 with Swift 5.8 fails due to a compiler error
when building swift-docc-plugin
(https://github.com/swiftlang/swift-docc-plugin/issues/94).
Modifications:
- Adjust the dependency version of swift-docc-plugin from `from:
"1.0.0"` to `"1.0.0"..<"1.4.0"`.
Result:
Building swift-nio-http2 with Swift 5.8 will now be successful.
# Motivation
We want to start using the GH based release notes drafting to make it easier for publishing new releases.
# Modification
This PR adds the `release.yml` and configured the correct labels
Motivation:
Currently, HEADERS frames are ignored by the client on a client-initiated stream after the client sends a GOAWAY.
As per [Section 6.8 (GOAWAY) in RFC 9113](https://httpwg.org/specs/rfc9113#GOAWAY):
_"Once the GOAWAY is sent, the sender will ignore frames sent on streams **initiated by the receiver** if the stream has an identifier higher than the included last stream identifier."_
In this case, the client (sender) should **not** ignore the HEADERS frame as the stream is initiated by the _client_, not the receiver.
Modifications:
Fixed the condition in the `receiveHeaders` function (given `LocallyQuiescingState`) in `ReceivingHeadersState.swift` to work for _both_ the client and server roles -- before this change, the condition is only correct when `self.role == ConnectionRole.server`
Result:
HEADERS frames are not ignored by the client on a client-initiated stream when locally quiescing.