Motivation:
We still had a bunch of docker files for NIO on Swift versions that NIO2
doesn't actually work on. Also we had allocation counter limits in
places where they don't mean anything.
Modifications:
Prune all the useless information.
Result:
Less configuration.
Motivation:
Due to https://bugs.swift.org/browse/SR-10614, assigning an array containing a tuple type
to a variable that expects an array containing a different-but-compatible tuple type will cause
an allocation and copy of that array storage.
In some cases this is necessary, but we were doing it in the HTTPHeaders constructors, which meant
that the swift-nio-http2 code was hitting a hilariously over the top number of allocations.
Modifications:
- Change the internal storage type of HTTPHeaders to match the public constructor.
Result:
Fewer allocations when constructing HTTPHeaders
Motivation:
Swift 5.1 shows much fewer allocations, let's tighten the limits.
Modifications:
Tighten the allocation limits on 5.1.
Result:
We'll catch allocation regressions much more easily.
Motivation:
We should test all available Swift versions, including snapshots.
Modifications:
Add docker compose file for Swift 5.1.
Result:
More testing.
Motivation:
Our original Heap implementation used a bunch of static functions
in order to make it clear how it related to textbook heap
implementations. This was primarily done to ensure that it was easier
to see the correctness of the code.
However, we've long been satisfied with the correctness of the code,
and the Heap is one of the best tested parts of NIO. For this reason,
we should be free to refactor it.
Given https://bugs.swift.org/browse/SR-10346, we've been given an
incentive to do that refactor right now. This is because the Heap
is causing repeated CoW operations each time we enqueue new work
onto the event loop. That's a substantial performance cost: well
worth fixing with a small rewrite.
Modifications:
- Removed all static funcs from Heap
- Rewrote some into instance funcs
- Merged the implementation of insert into append.
- Added an allocation test to avoid regressing this change.
Result:
Faster Heap, happier users, sadder textbook authors.
Motivation:
We shouldn't put warnings in developer's code in the convergence phase.
Modifications:
- remove NIO1APIShims warning
- update Swift
Result:
fewer warnings
Motivation:
The HTTP/1 headers were quite complicated, CoW-boxed and exposed their
guts (being a ByteBuffer). In Swift 5 this is no longer necessary
because of native UTF-8 Strings.
Modifications:
- make headers simply `[(String, String)]`
- remove `HTTPHeaderIndex`, `HTTPListHeaderIterator`, etc
Result:
- simpler and more performant code
Motivation:
The old HTTP parser tried to convert `http_parser` to a one-shot parser
by pausing it constantly. That was done to be resilient against
re-entrancy. But now, we have the new `ByteToMessageDecoder` which
protects against that so HTTP decoder can just become a real
`ByteToMessageDecoder`. It also serves as a great testbed for
`ByteToMessageDecoder`.
Modifications:
- make the HTTP decoder a `ByteToMessageDecoder`
- refactor the implementation
Result:
cleaner code, more use of `ByteToMessageDecoder`
Motivation:
The allocation tests were needlessly running the resolver within the
allocation counted loop.
Modifications:
- bump to Swift version 5.0
- take the resolving out of the allocation counting loop
Result:
more accurate results
Motivation:
If ChannelHandler removal worked correctly, it was often either by
accident or by intricate knowledge about the implementation of the
ChannelHandler that is to be removed. Especially when it comes to
re-entrancy it mostly didn't work correctly.
Modifications:
- introduce a `RemovableChannelHandler` API
- raise allocation limit per HTTP connection by 1
(https://bugs.swift.org/browse/SR-9905)
Result:
Make things work by contruction rather than accident
Motivation:
Newer Swift versions are good and we should test them, this one threw a few curveballs at us:
- started using `posix_memalign` which needed fixing in our alloc tests (fixed in #782)
- the optimiser decided not to inline a function that needs to be inlined
Modifications
- `@inline(__always)` to help the optimiser
- update Swift version
Result:
- fixes#727
- fixes#726
Motivation:
Certain warnings we want to ignore in CI builds but we want to keep
`-warnings-to-errors` on.
Modifications:
define `NIO_CI_BUILD` in the CI builds
Result:
can ignore select warnings in CI
Motivation:
Forgot to introduce the -warnings-as-errors parameter in the `test:`
directive in the docker compose file.
Modifications:
added warnings-to-errors to the docker-compose.yml for 5.0
Result:
warnings to errors
Motivation:
Swift 5 contains a regression where we get 1 extra allocations for the
ByteBuffer read/write allocation test.
I will track this problem down but for now it's important to unblock
other NIO2 work.
Modifications:
raise the allowed allocations for the ByteBuffer RW test by 1
Result:
allocation tests can be re-enabled again.
Motivation:
Swift 5 contains a regression where we get 2 extra allocations per
HTTP/1.1 request/response pair _only on Linux_. That happens both on
`master` as well as on `nio-1.12`.
I will track this problem down but for now it's important to unblock
12 work.
Modifications:
raise the allowed allocations per HTTP/1.1 req/res pair to 38 (from 36)
for Swift 5.
Result:
allocation tests can be re-enabled again.
Motivation:
that snapshot fixes https://bugs.swift.org/browse/SR-9518 which blocks
the allocation tests and therefore #710 .
Modifications:
made our docker use the 2012-12-28 snapshot.
Result:
allocation tests hopefully work again because Swift doesn't accidentally
forget to decrease some reference count anymore.
Motivation:
SwiftPM was very outdated on the old Swift snapshots, we should update
the CI.
Modifications:
use swift-5.0-DEVELOPMENT-SNAPSHOT-2018-12-13-a-ubuntu18.04.tar.gz
Result:
can use swift-tools-version: 5.0 and all the goodies from that
Motivation: enable tests against swift 5.0
Modifications:
* add a docker-compose file for ubuntu 18.04 and swift 5.0-DEVELOPMENT-SNAPSHOT-2018-12-04-a
* update Dockerfile to correctly handle development builds
Result:
* you can now test against swift 5.0 with docker-compose -f docker/docker-compose.yaml -f docker/docker-compose.1804.50.yaml run test
Motivation:
We always care most about the latest released Swift version. Therefore I
added allocation limits for Swift 4.2 and indicated that the old ones
can be removed as soon as they change.
Modifications:
- added allocation limits for Swift 4.2
- added a comment to the old ones that they don't need to be changed
anymore now
Result:
- best support for best version
- document that Swift 4.2 is awesome, lots fewer allocations!
Motivation:
Now that 4.2 has been released, there's no reason to use the CONVERGENCE
version anymore.
Modifications:
use the RELEASE instead of the CONVERGENCE version of Swift 4.2
Result:
use the latest and greatest
Motivation:
We should support the latest and greatest.
Modifications:
- add Ubuntu 18.04 support (packages exist for Swift 4.2 only)
- add Swift 4.2 support (for Ubuntu 14.04, 16.04 and 18.04)
Result:
- supporting the latest stuff
Motivation:
swift-nio example projects (http, echo) don't print anything to the console when running inside docker container because of buffering issue.
Modifications:
Added tty: true to the docker-compose.yaml for http & echo.
Result:
Buffering issue is resolved. http & echo prints logs to the console.
Motivation:
We knew since before that on Ubuntu 16.04 we have one more allocation
per connection that on 14.04 (presumably due to resolver differences or
something in the system). When I last updated the allocation limits
however I forgot that...
Modifications:
- raise 16.04 allocation limit by 1 allocation
Result:
- integration tests should pass on 16.04
Motivation:
Previously we were not running the (child/server)channelInitializers on the
event loop associated to the `Channel` we're initialising. Almost all
operations in there are pipeline modifications which are thread safe so
it presumably wasn't a massive correctness issue. However it's very
expensive to hop threads that often and it is also very unexpected. This
addresses this issue.
Modifications:
made all (child/server)channelInitializers run on the event loop that is
associated to their `Channel`
Result:
- more correctness
- less unexpected behaviour
Motivation:
If registration of a Channel fails we need to close that Channel.
Previously we'd just drop it on the floor which triggers an assertion
that an open channel got leaked.
Modifications:
In cases where the Channel registration fails, we need to close that
channel.
Result:
- No crashes if registration fails.
- fixes#417
Motivation:
We reduced allocations again, let's reset the limits.
Modifications:
lowed a bunch of limits to
- MAX_ALLOCS_ALLOWED_1000_reqs_1_conn=47000
- MAX_ALLOCS_ALLOWED_1_reqs_1000_conn=776100
- MAX_ALLOCS_ALLOWED_ping_pong_1000_reqs_1_conn=4600
- MAX_ALLOCS_ALLOWED_bytebuffer_lots_of_rw=3100
- MAX_ALLOCS_ALLOWED_future_lots_of_callbacks=99100
Result:
tighter limits should find regressions more easily
Motivation:
We don't want to regress the number of heap allocations we perform.
Modifications:
Added appropriate environment variables to Docker files.
Result:
Things go bang if we regress Future allocation counts.
Motivation:
be able to run the sanity check via docker compose
Modifications:
add sanity task to docker compose file
Result:
you can now run sanity check via docker
Motivation: easier testing across different permutations of os and language versions
Modifications:
* update dockerfile to take both swift_version adn ubuntu_version
* update default linux version to 16.04
* create multiple docker-compose files that use arguments to define os and swift versions
* make docker-compose file DRYer with yaml anchors
Result: users/ci can easily run tests across various versions of ubuntu and swift
Motivation:
In order to target the latest version of Swift and address this issue https://github.com/apple/swift-nio/issues/83
Modifications:
Set the Swift version to the latest (4.0.3)
Result:
Uniform version of Swift across the Ubuntu Docker image and a passing
test suite on all target platforms
Motivation:
When building our docker image a lot of warnings showed up.
Modification:
- Ensure we not try to start services on installation
- Redirect STDERR
- Remove some commented lines
Result:
Less warnings during building the docker image.
Motivation:
repository currently contains two seperate docker definitions that are confusing to users
Modifications:
* remove Dockerfile.xenial so we have a canonical docker file for CI and developer testing
* point docker compose to canonical docker file
* define docker compose services for unit and integration tests. and make "test" service run both
* update readme
Result:
users are less confused about docker setup
Motivation:
set up continuous integration
Modifications:
* update docker file to include all dependencies required for build, unit tests, integration tests and doc generation
* remove dependency steps from doc generation script
* add integration tests driver script
Result:
able to set up docker based continuous integration
Motivation:
We need to mount the ~/.ssh directory into the docker image as we use git@ to checkout our dependencies.
Modifications:
Use ~/.ssh as volume as well.
Result:
Be able to use docker images again.
* Docker work
- New image based on xenial.
- Simplified workflow with docker-compose
- Update the readme with docker-compose section
- Move docker related stuff to a dedicated folder
* Add a gen-cert.sh to the container image
* Document certificate generation and how to test all sample servers