24 Commits
Author SHA1 Message Date
Peter AdamsandJohannes Weiss 59e864c1a2 Enable thread sanitizer in CI (#212)
Motivation:

Thread Sanitizer will find bugs which might be missed otherwise.

Modifications:

When running docker image for 1604/5.1 tests and h2spec are both compiled with --sanitize=thread

Result:

Tests are run with thread sanitizer turned on.

Co-authored-by: Johannes Weiss <johannesweiss@apple.com>
2020-07-23 14:08:48 +01:00
Peter Adams 9feeb176ce Don't install Jazzy on Xenial (#211)
Motivation:

Ruby on Xenial is too old for the cocoapods downloader which jazzy uses.

Modifications:

Change Dockerfile to not install Jazzy on xenial.

Result:

Dockerfile will build again, but bionic or later is required for docs.
2020-07-21 18:03:06 +01:00
tomer doron 1cd4b833b3 improve 5.3 docker setup (#201)
motivation: pin to 5.3 nighties 

changes: use swiftlang/swift:nightly-5.3-master-bionic instead of swiftlang/swift:nightly-master-bionic
2020-05-05 07:04:57 +01:00
Cory Benfield b26b154c4a Fixup the docker setup. (#196) 2020-04-20 19:02:19 +01:00
tomer doron 73be3a1d8b improve docker security (#180)
motivation: more secured ci setup

changes:
* enable :z selinux flag on bind mounts so we can enable selinux on ci
* drop potentially exploitable capabilities from docker-compose
2020-02-01 07:41:23 +00:00
Johannes Weiss 994c319e03 namespace ChannelOptions & fix deprecations (#166) 2019-10-28 16:11:12 +00:00
tomer doron 97e8bbbcf8 api breakage detection (#163)
motivation: test for api breakage on PR

changes:
* add script to detect api breakage
* amend docker setup to include jq
2019-10-07 15:00:10 -07:00
tomer doron 84189320bc swift 5.1 docker setup (#158)
* swift 5.1 docker setup

motivation: support swift 5.1

changes:
* add docker compose file for swift 5.1, will add CI job once merged
* update swiftformat version to 0.40.12
* use more standard dockerfile setup

* 16.04
2019-09-24 21:58:38 +01:00
Johannes Weiss 93f9b98b83 fix allocation counter limits (#148)
Motivation:

We regressed 4 allocations in the security update
https://github.com/apple/swift-nio-http2/security/advisories/GHSA-jchv-x857-q8fq
. Four allocations are a great tradeoff for a number of security
vulnerabilities fixed but we need to raise the limits accordingly.

Modifications:

Raise the limits to the new limit so tests can pass again.

Result:

PRs can pass again and master should build again.
2019-08-13 18:24:46 +01:00
Cory Benfield 492a77b186 Support child channel writability management. (#142)
Motivation:

It's important to ensure that child channel users can observe the
writability state of a child channel in order to avoid ballooning data
in memory. Up until now we haven't supported writability notifications,
but we really should.

Modifications:

- Added a flow controller to manage writability.
- Managed data flow through promises.
- Lots of tests.

Result:

Child channels will provide a much better signal as to whether they are
writable.
2019-07-19 16:49:22 +01:00
tomer doron 3d0b38268e add performance analysis docker-compose setup and script (#141)
motivation: prepare to run performance tests in ci

changes:

add performance-test docker-compose task
add script that can parse the performance test suite results and compare between two result-sets
add generic shell docker-compose task
2019-07-16 11:04:26 +01:00
tomer doron c7c0ca91bf use official docker image (#130)
motivation: now that swift has official docker images, use them instead of the homebrewed one

changes: refactor docker file to use swift:version instead of ubuntu:version
2019-05-21 16:43:48 -07:00
tomer doron e25490e336 improve docker test setup (#129)
motivation: test task to include h2spec

changes:
* remove older docker-compose files that are not in use on the master branch
* move the task definition from the 18.04/5.0 docker compose file to the generic one
* create a unit-test task to encapsulate the unit tests and change the test task to include unit tests, integration tests and h2 spec verification
2019-05-21 09:49:24 +01:00
Cory Benfield 2d5ab32f23 Remove indirection between channel and multiplexer (#126)
Motivation:

Previously the HTTP2StreamChannel forwarded all frames to the parent
Channel by way of the abstract Channel existential API. While this was
straightforward, it added unnecessary overhead due to the extra pipeline
steps and the extra indirection of the types providing an inlining
barrier.

Given that in #116 we gave the HTTP2StreamChannel a reference to its
parent multiplexer, we may as well take advantage of this and allow
direct calls from the stream channel into the multiplexer.

Modifications:

Avoided calls to parent.write and parent.flush.
Replaced them with a new interface.
Added new allocation test for this path.

Result:

Slightly better performance.
2019-05-17 18:58:08 +01:00
Johannes Weiss 8fb84b260a enable warnings as errors (#127)
Motivation:

Warnings are bad, let's make them errors.

Modifications:

enable `-warnings-as-errors`

Result:

Fewer warnings.
2019-05-17 18:15:30 +01:00
Johannes Weiss 16fae8a3d1 add the first allocation tests for nio-http2 (#122)
Motivation:

Allocation tests are good :).

Modifications:

Add two allocations tests and NIO's integration test framework.

Result:

Hopefully fewer allocations in the future. And better ways to check what
allocations are happening.
2019-05-17 14:36:46 +01:00
tomer doron 13d9b4852e add doc generation script (#77)
motivation: publish API docs

changes:
* amend docker file to include jazzy
* add doc generation script based on what we have in swift-nio and swift-log
2019-03-27 09:33:19 +00:00
Johannes Weiss a4a1d9c727 use Swift 5.0 release (#74) 2019-03-26 11:20:13 +00:00
Cory Benfield 42087764b1 Add Dockerfile to run h2spec. (#41)
Motivation:

When we get around to it we should aim for our example server to pass
h2spec with flying colours. We aren't there yet, but it's helpful to
be able to run h2spec easily.

Modifications:

Add a docker-compose recipe for running h2spec.

Result:

It'll be easier to run h2spec.
2019-02-21 16:32:29 +00:00
Cory Benfield 3c90345c36 Pure-Swift HTTP/2 implementation (#40)
* Updated to use SwiftNIO 1.10+ to gain access to HTTPHeaders internals.

* Add pure-Swift HTTP/2 protocol implementation.

Motivation:

Currently we use nghttp2 for our basic protocol implementation. This is
plenty workable, but provides us a number of limitations. It adds
complexity to our build system, provides us with external dependencies we
have little control over, limits our users' ability to express low-level
protocol semantics if they so wish, causes us to heap-allocate like crazy over
the lifetime of a connection, and brings a world of pain around reentrancy.

This set of limitations has motivated a desire to move away from using
nghttp2. This is a part of that dream.

Modifications:

- Add pure Swift protocol implementations.
- Test them.

Results:

Another step towards protocol independence.

* Initial basic parser code.

* Adding unit tests.

* Add NIOHTTP2FlowControlHandler

Motivation:

One of the things that nghttp2 used to do for us was to handle buffering
DATA frames until flow control allowed them to go out. For users that
want that behaviour, we need to replace the nghttp2 code with a new
ChannelHandler that can do this work.

Modifications:

- Added NIOHTTP2FlowControlHandler.

Result:

Users will have the same feature set as they did with nghttp2.

* Generate Linux test information.

* Documentation comment.

* Updated new tests from master to use new payload types.

* Updated following review.

Notable changes:

- Implemented unit tests for the ALTSVC (0xa) and ORIGIN (0xc) frame types.
- Additional DATA frames are synthesized to wrap individual payload chunks as they arrive. If the payload of a DATA frame with 4MB data arrives in 4 separate 1MB chunks, the decoder will emit 4 DATA frames, with only the last containing the END_STREAM flag (if that was set on the incoming frame).
- HEADERS / PUSH_PROMISE frames and any following CONTINUATION frames are now handled properly: header fragments from all frames are gathered up into a single buffer. Once a frame with END_HEADERS is encountered, the resultant accumulated buffer is sent for decoding along with the flags and stream ID of the original HEADERS / PUSH_PROMISE frame.
- HPACK encoders/decoders now live in the frame encoder/decoder types, rather than being attached to a stream.

* Updated Linux tests.

* Headers placed in relevant files.

* Add pure-Swift HTTP/2 protocol implementation.

Motivation:

Currently we use nghttp2 for our basic protocol implementation. This is
plenty workable, but provides us a number of limitations. It adds
complexity to our build system, provides us with external dependencies we
have little control over, limits our users' ability to express low-level
protocol semantics if they so wish, causes us to heap-allocate like crazy over
the lifetime of a connection, and brings a world of pain around reentrancy.

This set of limitations has motivated a desire to move away from using
nghttp2. This is a part of that dream.

Modifications:

- Add pure Swift protocol implementations.
- Test them.

Results:

Another step towards protocol independence.

* Revamped frame decoder state machine and API. Now uses separate input and output methods to manage multiple frames in a single buffer.

* Updated Linux tests.

* Bumped swift-nio version to 1.12.0 and updated `HTTPHeaders` -> `HPACKHeaders` conversion initializer to directly copy the buffer and map the header name/value indices.

* Set up HTTP2Parser in handlerAdded if the channel had been previously activated. (#36)

By setting up the handler in the handlerAdded hook, HTTP2Parser supports
being added dynamically in a channelRead event, after the channel has sent
the channelActive event.

(cherry picked from commit 88bd6d369a)

* Minor tweaks to get the tests passing

* Initial integration here

* Minor clearing up of the handler

* Get the tests compiling

* Fix header issues.

We now pass the frame parser to the various setting operations to let it
update the state. We also fixed some issues with specific settings.

* Remove ngthttp2-based impl, clean up stream ID

* Tests with new HTTP2StreamID

* Simple test cleanup

* Get remaining non-core tests passing

* Allow GOAWAY even when fully quiesced

* We don't buffer outbound frames any more

* Emit StreamClosed events on GoAway frame

* Notify stream creation and closure

* This test started failing

* Goodbye, C code! 🎉

* Send PING ACK automatically

* Updated based on PR feedback.

* Correctly handle 1XX responses

* Add SETTINGS_MAX_FRAME_SIZE support to flow controller

* Correctly account for flow control

* Define ConcurrentStreamsHandler

* Prepare for signalling connection state changes

* Better state change message propagation

* Refactor to use result with effect everywhere

* Don't lose flow control info on stream error

* Add basic flow control management to stream multiplexer

* Better pipeline in sample server

* Clean up some reentrancy concerns

* Move to Swift 5 and NIO 2

* Move to new Swift 5 for CI

* Allow wider range of choices of years

* Catch up to NIO 2 again
2019-02-21 11:52:49 +00:00
tomer doron dd9339e631 add missing ruby install step to docker file (#34)
motivation: ruby is required for varisou scripts and got dropped in the recent changeset

changes: add ruby installation stanza to dockefile
2018-12-12 10:17:32 -08:00
tomer doron bac4b07441 update docker setup (#33)
motivation: support swift 4.2 and 5.0

changes:
* add docker-compose variants for 18.04/4.2 and 18.04/5.0
* update Dockerfile to more correctly handle swift distro urls
* update Dockerfile to more correctly handle curl
* drop redundant ubuntu prefix
2018-12-11 08:15:14 +00:00
Cory Benfield f1d875433f Add support for Ubuntu 16.04's packaged nghttp2. (#29)
Motivation:

We'd done all our development against newer copies of nghttp2, that
behaved a bit differently. We should support Ubuntu's copy, at least
while nghttp2 is relevant to us.

Modifications:

- Shimmed over a version difference.
- Fixed the tests to stop relying on differences.
- Removed the Swift 4.0.3 dockerfiles as we don't support Swift
  4.0 anyway.

Result:

Users can build against Ubuntu 16.04's nghttp2 package.
2018-12-04 14:20:24 +00:00
tomer doron 720bd5f2e5 add docker setup (#3)
motivation: add required files for ci setup

changes:
* add sanity script to test for oss headers and linux tests
* add docker and docker-compose files for docker based tests
2018-05-18 09:33:34 +01:00