39 Commits
Author SHA1 Message Date
Johannes Weiss 874a883e33 use Swift 5.0-RELEASE (#926)
Motivation:

Now that Swift 5 is released, we should use the release version.

Modifications:

switch to Swift 5.0-RELEASE.

Result:

newer, shinier
2019-03-26 08:49:10 +00:00
Johannes Weiss 32b0be4626 DEVELOPMENT-SNAPSHOT-2019-03-10-a (#920) 2019-03-25 12:19:58 +02:00
Johannes Weiss 577604e850 disable NIO1APIShim's warning (#889)
Motivation:

We shouldn't put warnings in developer's code in the convergence phase.

Modifications:

- remove NIO1APIShims warning
- update Swift

Result:

fewer warnings
2019-03-08 18:10:03 +00:00
Johannes Weiss 22e6cd3c67 HTTP/1 headers simplification & cleanup (#857)
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
2019-03-06 18:11:40 +00:00
Johannes Weiss f1efb4a104 new http parser (#814)
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`
2019-03-06 11:51:42 +00:00
Johannes Weiss 65e5df240b DEVELOPMENT-SNAPSHOT-2019-03-04-a (#871) 2019-03-05 12:48:58 +00:00
Johannes Weiss ac26c7298d slight improvements to the allocation tests (#859)
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
2019-03-01 18:53:25 +00:00
Johannes Weiss fda5e5f334 update to 5.0-DEVELOPMENT-SNAPSHOT-2019-02-20-a (#832) 2019-02-21 16:27:00 +00:00
Johannes Weiss 30446eea52 update to 5.0-DEVELOPMENT-SNAPSHOT-2019-02-06-a (#821) 2019-02-13 10:14:41 +01:00
Johannes Weiss d938264fcb better ChannelHandler removal API (#767)
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
2019-02-12 11:27:48 +01:00
Johannes Weiss c45c7e181c use DEVELOPMENT-SNAPSHOT-2019-01-28-a
Motivation:

New Swift versions are great.

Modifications:

Upgrade to 5.0-DEVELOPMENT-SNAPSHOT-2019-01-28-a.

Result:

Should unblock #769.
2019-01-29 11:52:20 +00:00
Johannes Weiss 58a58b9680 CI: use DEVELOPMENT-SNAPSHOT-2019-01-23-a (#780)
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
2019-01-25 23:50:01 +00:00
Johannes Weiss 72370b6b42 defined NIO_CI_BUILD in the CI builds (#765)
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
2019-01-21 15:24:51 +00:00
Johannes Weiss a5b6ca06ab actually enable warnings as errors (#759)
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
2019-01-19 20:32:13 +00:00
Johannes Weiss 3ce1c25dfb raise Swift 5 ByteBuffer read/write allocation limit (#729)
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.
2019-01-03 08:25:04 +00:00
Johannes Weiss 0221ab8efc raise Swift 5 HTTP/1 req/res pair alloc limits (#725)
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.
2019-01-02 19:35:17 +00:00
Johannes Weiss e41c21c42c use the Swift 5.0 snapshot from 2018-12-28 (#724)
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.
2019-01-02 17:00:32 +00:00
Johannes Weiss 885ac373ad fix remaining warnings & -warnings-as-errors (#712)
Motivation:

Warnings are bad.

Modifications:

- fixed remaining warnings
- enabled -warnings-as-errors

Result:

happier devs
2018-12-17 17:13:25 +00:00
Johannes Weiss b154b1988a CI: update to Swift snapshot 13th Dec 2018 (#703)
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
2018-12-14 10:52:38 +00:00
tomer doron 94c2bc4d25 add support for swift 5.0 (#679)
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
2018-12-06 14:25:02 -08:00
Johannes Weiss 79267e893b make the allocation limits for Swift 4.2 the main ones (#621)
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!
2018-09-20 21:21:11 +01:00
Johannes Weiss cb2367f391 CI: use Swift 4.2-RELEASE instead of CONVERGENCE (#616)
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
2018-09-18 17:10:37 +01:00
Johannes Weiss 89603d6244 add Ubuntu 18.04 and Swift 4.2 support (#604)
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
2018-09-07 14:54:23 -07:00
Eugen a8a18ba222 add 'tty: true' to the docker-compose file (#490) (#491)
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.
2018-06-25 21:11:58 +01:00
Johannes Weiss 5b8b28a986 raise Ubuntu 16.04 allocation limit by 1 allocation (#441)
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
2018-05-24 21:03:13 +02:00
Johannes Weiß 80363d9d8c fix EventLoops that Bootstrap channel initialiser's call out on (#424)
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
2018-05-22 15:58:43 +01:00
Johannes Weiss ec880b0853 don't just drop Channels on the floor if registration fails
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
2018-05-22 11:29:20 +01:00
Johannes Weiß 325bbdd242 lower allocation limits (#390)
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
2018-05-04 18:45:11 +01:00
Cory Benfield 1013cddd8f Track Future allocations in CI. (#376)
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.
2018-05-01 15:10:36 +01:00
tomer doron 093328e1b3 expose sanity script through docker compose (#375)
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
2018-05-01 03:12:05 -07:00
tomer doron 8914a5536e extend docker setup to multiple version of ubuntu and swift (#357)
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
2018-05-01 08:56:39 +01:00
Tiago Martinho 8e98d84076 Set Swift version to 4.0.3 in Docker configuration (#89)
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
2018-03-12 18:47:46 +09:00
Norman Maurer c8d1980207 Cleanup DockerFile to eliminate warnings (#121)
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.
2018-03-11 22:53:08 +09:00
Stuart Hinson c583298096 Download curl from https endpoint (#116) 2018-03-09 02:03:00 +09:00
tomer doron 142ee43906 docker cleanup (#90)
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
2018-03-05 19:37:29 +09:00
tomer doron 9652984b60 prepare ci scripts (#32)
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
2018-02-26 11:27:53 +00:00
Norman Maurer 776a0698ba Mount ~/.ssh into docker image (#23)
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.
2018-02-23 09:34:22 +00:00
Cory Benfield dfe3fe212a Better readme for release 2018-02-09 12:25:50 +00:00
Max (Swift) Moiseev 8d4eb477ed Xenial and compose
* 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
2017-11-09 21:34:51 -08:00