Commit Graph

457 Commits

Author SHA1 Message Date
Norman Maurer
d23feba2fa [maven-release-plugin] prepare for next development iteration 2017-11-09 00:08:30 +00:00
Norman Maurer
f571151794 [maven-release-plugin] prepare release netty-4.0.53.Final 2017-11-09 00:05:39 +00:00
Norman Maurer
b30d73e013 [maven-release-plugin] prepare for next development iteration 2017-09-21 19:47:23 +00:00
Norman Maurer
4e9a6e5ab6 [maven-release-plugin] prepare release netty-4.0.52.Final 2017-09-21 19:47:02 +00:00
Norman Maurer
dec1679c6e Fix assertion error when closing / shutdown native channel and SO_LINGER is set.
Motivation:

When SO_LINGER is used we run doClose() on the GlobalEventExecutor by default so we need to ensure we schedule all code that needs to be run on the EventLoop on the EventLoop in doClose. Beside this there are also threading issues when calling shutdownOutput(...)

Modifications:

- Schedule removal from EventLoop to the EventLoop
- Correctly handle shutdownOutput in respect with threading-model
- Add unit tests

Result:

Fixes [#7159].
2017-09-18 21:13:24 -07:00
Norman Maurer
a27624a77b [maven-release-plugin] prepare for next development iteration 2017-08-24 12:47:31 +00:00
Norman Maurer
cf89fb78b8 [maven-release-plugin] prepare release netty-4.0.51.Final 2017-08-24 12:46:31 +00:00
Scott Mitchell
043e847794 Increase test timeout for SocketStringEchoTest
Motivation:
SocketStringEchoTest has been observed to fail on CI servers, but the stack traces still indicate work was being done.

Modifications:
- Increase the test timeout

Result:
Tests have more time to complete, and hopefully less false positive test failures.
2017-08-12 11:20:07 -07:00
Scott Mitchell
8e016eddf6 SocketGatheringWriteTest increase timeouts
Motivation:
EpollDomainSocketGatheringWriteTest. testGatheringWriteBig takes on average about 20-25 seconds on the CI servers, but there is a 30 second timeout being applied which leads to what maybe false positive test failures.

Modifications:
- Increase the test timeout to 120 seconds globally and 60 seconds to wait for all writes per test

Result:
Higher timeout for potentially less false positive test failures.
2017-08-11 00:16:06 -07:00
Scott Mitchell
a044f1705a SocketGatheringWriteTest improvements
Motivation:
SocketGatherWriteTest has been observed to fail and it has numerous issues which when resolved may help reduce the test failures.

Modifications:
- A volatile counter and a spin/sleep loop is used to trigger test termination. Incrementing a volatile is generally bad practice and can be avoided in this situation. This mechanism can be replaced by a promise. This mechanism should also trigger upon exception or channel inactive.
- The TestHandler maintains an internal buffer, but it is not released. We now only create a buffer on the server side and release it after comparing the expected results.
- The composite buffer creation logic can be simplified, also the existing composite buffer doesn't take into account the buffer's reader index when building buf2.

Result:
Cleaner test.
2017-08-11 07:17:05 +02:00
Scott Mitchell
0fe8eb52bc SocketStringEchoTest improvements
Motivation:
SocketStringEchoTest has been observed to fail and it has numerous issues which when resolved may help reduce the test failures.

Modifications:
- A volatile counter and a spin/sleep loop is used to trigger test termination. Incrementing a volatile is generally bad practice and can be avoided in this situation. This mechanism can be replaced by a promise. This mechanism should also trigger upon exception or channel inactive.
- Asserts are done in the Netty threads. Although these should result in a exceptionCaught the test may not observe these failures because it is spinning waiting for the count to reach the desired value.

Result:
Cleaner test.
2017-08-11 07:12:54 +02:00
Norman Maurer
fb8e2dfc69 Correctly support SO_TIMEOUT for OioDatagramChannel
Motivation:

We need to support SO_TIMEOUT for the OioDatagramChannel but we miss this atm as we not have special handling for it in the DatagramChannelConfig impl that we use. Because of this the following log lines showed up when running the testsuite:

20:31:26.299 [main] WARN  io.netty.bootstrap.Bootstrap - Unknown channel option 'SO_TIMEOUT' for channel '[id: 0x7cb9183c]'

Modifications:

- Add OioDatagramChannelConfig and impl
- Correctly set SO_TIMEOUT in testsuite

Result:

Support SO_TIMEOUT for OioDatagramChannel and so faster execution of datagram related tests in the testsuite
2017-08-08 09:15:14 +02:00
Scott Mitchell
bc8ddd4df2 Shutting down the outbound side of the channel should not accept future writes
Motivation:
Implementations of DuplexChannel delegate the shutdownOutput to the underlying transport, but do not take any action on the ChannelOutboundBuffer. In the event of a write failure due to the underlying transport failing and application may attempt to shutdown the output and allow the read side the transport to finish and detect the close. However this may result in an issue where writes are failed, this generates a writability change, we continue to write more data, and this may lead to another writability change, and this loop may continue. Shutting down the output should fail all pending writes and not allow any future writes to avoid this scenario.

Modifications:
- Implementations of DuplexChannel should null out the ChannelOutboundBuffer and fail all pending writes

Result:
More controlled sequencing for shutting down the output side of a channel.
2017-08-04 11:36:09 -07:00
Norman Maurer
6141c5bd3c Correctly handle connect/disconnect in EpollDatagramChannel
Motivation:

We did not correctly handle connect() and disconnect() in EpollDatagramChannel and so the behavior was different compared to NioDatagramChannel.

Modifications:

- Correct implement connect and disconnect methods
- Share connect and related code
- Add tests

Result:

EpollDatagramChannel also supports correctly connect() and disconnect() methods.
2017-08-04 10:47:05 +02:00
Norman Maurer
d0d1105e45 [maven-release-plugin] prepare for next development iteration 2017-08-02 20:29:15 +02:00
Norman Maurer
5d304e9521 [maven-release-plugin] prepare release netty-4.0.50.Final 2017-08-02 20:28:37 +02:00
Norman Maurer
928a9e9eaa Update tests to not use TestUtils.getFreePort() and so ensure we not try to use a port that is used by the system in the meantime.
Motivation:

We should not try to detect a free port in tests put just use 0 when bind so there is no race in which the system my bind something to the port we choosen before.

Modifications:

- Remove the usage of TestUtils.getFreePort() in the testsuite
- Remove hack to workaround bind errors which will not happen anymore now

Result:

Less flacky tests.
2017-07-20 09:17:14 +02:00
Norman Maurer
9eeb86db4c Explicit specify hostaddress during tests to ensure testsuite pass on docker (mac)
Motivation:

When run the current testsuite on docker (mac) it will fail a few tests with:

io.netty.channel.AbstractChannel$AnnotatedConnectException: connect(..) failed: Cannot assign requested address: /0:0:0:0:0:0:0:0%0:46607
Caused by: java.net.ConnectException: connect(..) failed: Cannot assign requested address

Modifications:

Specify host explicit as done in other tests to only use ipv6 when really supported.

Result:

Build pass on docker as well
2017-07-18 07:24:24 +02:00
Norman Maurer
dde14d2a65 [maven-release-plugin] prepare for next development iteration 2017-07-06 07:37:47 +02:00
Norman Maurer
1e50efb615 [maven-release-plugin] prepare release netty-4.0.49.Final 2017-07-06 07:37:30 +02:00
Norman Maurer
7aa8ad1841 [maven-release-plugin] prepare for next development iteration 2017-06-09 11:23:06 +02:00
Norman Maurer
b6be3a77bc [maven-release-plugin] prepare release netty-4.0.48.Final 2017-06-09 11:22:25 +02:00
Norman Maurer
a2bd9a4399 Correctly handle ByteBuf implementations which have no memoryAddress when writing to native transport
Motivation:

Commit 3c4dfed08a introduced a regression in handling buffers that have no memoryAddress.

Modifications:

Fix regression and also add unit tests.

Result:

It's possible again to write buffers without memory address.
2017-06-07 20:05:16 +02:00
louxiu
a358338552 Fix handle of ByteBuf with multi nioBuffer in EpollDatagramChannel
Motivation:
1. special handling of ByteBuf with multi nioBuffer rather than type of CompositeByteBuf (eg. DuplicatedByteBuf with CompositeByteBuf)
2. EpollDatagramUnicastTest and passed because CompositeByteBuf is converted to DuplicatedByteBuf before write to channel
3. uninitalized struct msghdr will raise error

Modifications:
1. isBufferCopyNeededForWrite(like isSingleDirectBuffer in NioDatgramChannel) checks wether a new direct buffer is needed
2. special handling of ByteBuf with multi nioBuffer in EpollDatagramChannel, AbstractEpollStreamChannel and IovArray
3. initalize struct msghdr

Result:
handle of ByteBuf with multi nioBuffer in EpollDatagramChannel is ok
2017-05-26 13:37:25 +02:00
Norman Maurer
a45f63aea0 Only try to deregister from EventLoop when the native Channel was registered before.
Motivation:

We only can call eventLoop() if we are registered on an EventLoop yet. As we just did this without checking we spammed the log with an error that was harmless.

Modifications:

Check if registered on eventLoop before try to deregister on close.

Result:

Fixes [#6770]
2017-05-24 13:20:51 +02:00
Norman Maurer
c9b5415c91 [maven-release-plugin] prepare for next development iteration 2017-05-11 12:26:35 +02:00
Norman Maurer
9c432f8ae1 [maven-release-plugin] prepare release netty-4.0.47.Final 2017-05-11 12:26:15 +02:00
Norman Maurer
8d73e2637a [maven-release-plugin] prepare for next development iteration 2017-04-29 15:21:48 +02:00
Norman Maurer
cdc6671828 [maven-release-plugin] prepare release netty-4.0.46.Final 2017-04-29 15:21:21 +02:00
Nikolay Fedorovskikh
0444d4e165 fix the typos 2017-04-20 05:19:06 +02:00
Norman Maurer
577757198b [maven-release-plugin] prepare for next development iteration 2017-03-10 09:37:31 +01:00
Norman Maurer
f994184afd [maven-release-plugin] prepare release netty-4.0.45.Final 2017-03-10 09:02:39 +01:00
Scott Mitchell
5493ad8b40 Fix compile error introduced by 21457d88c9 2017-03-07 16:02:17 -08:00
Jason Brown
21457d88c9 Motivation:
Make the FileRegion comments about which transports are supported more accurate.
Also, eleminate any outstanding references to FileRegion.transfered as the method was renamed for spelling.

Modifications:

Class-level comment on FileRegion, can call renamed method.

Result:

More accurate documentation and less calls to deprecated methods.
2017-03-06 14:44:09 -08:00
Nikolay Fedorovskikh
f7fa1d56e8 Make methods 'static' where it missed
Motivation:

Calling a static method is faster then dynamic

Modifications:

Add 'static' keyword for methods where it missed

Result:

A bit faster method calls
2017-02-23 11:23:25 +01:00
Norman Maurer
866107ac11 Move AutobahnTestsuite to extra module
Motivation:
We should move the AutobahnTestsuite to an extra module. This allows easier to run only the testsuite or only the autobahntestsuite

Modifications:

Create a new module (testsuite-autobahn)

Result:

Better project structure.
2017-02-21 10:14:09 +01:00
Norman Maurer
f9727e36f8 Update to autobahntestsuite-maven-plugin 0.1.4 to support Java9
Motivation:

autobahntestsuite-maven-plugin 0.1.4 was released and supports Java9.

Modifications:

Update plugin to be able to run tests on Java9

Result:

Autobahntestsuite can also be run on Java9.
2017-02-20 20:54:41 +01:00
Norman Maurer
da94a908ad Prefer JDK ThreadLocalRandom implementation over ours.
Motivation:

We have our own ThreadLocalRandom implementation to support older JDKs . That said we should prefer the JDK provided when running on JDK >= 7

Modification:

Using ThreadLocalRandom implementation of the JDK when possible.

Result:

Make use of JDK implementations when possible.
2017-02-17 07:36:11 +01:00
Norman Maurer
3fa3709005 Make netty build work on Java9
Motivation:

We missed some stuff in 5728e0eb2c and so the build failed on java9

Modifications:

- Add extra cmdline args when needed
- skip the autobahntestsuite as jython not works with java9
- skip the osgi testsuite as the maven plugin not works with java9

Result:

Build finally passed on java9
2017-02-16 20:27:24 +01:00
Norman Maurer
13b4aba555 Use the correct arguments when run with jdk9
Motivation:

We need to pass special arguments to run with jdk9 as otherwise some tests will not be able to run.

Modifications:

Allow to define extra arguments when running with jdk9

Result:

Tests pass with jdk9
2017-02-15 10:20:05 +01:00
Norman Maurer
917952d0a9 Only use Mockito for mocking.
Motivation:

We used various mocking frameworks. We should only use one...

Modifications:

Make usage of mocking framework consistent by only using Mockito.

Result:

Less dependencies and more consistent mocking usage.
2017-02-07 08:56:36 +01:00
Norman Maurer
0fbad09535 [maven-release-plugin] prepare for next development iteration 2017-01-30 17:42:39 +01:00
Norman Maurer
452812a62d [maven-release-plugin] prepare release netty-4.0.44.Final 2017-01-30 17:42:07 +01:00
Tim Brooks
095be39826 Wrap operations requiring SocketPermission with doPrivileged blocks
Motivation:

Currently Netty does not wrap socket connect, bind, or accept
operations in doPrivileged blocks. Nor does it wrap cases where a dns
lookup might happen.

This prevents an application utilizing the SecurityManager from
isolating SocketPermissions to Netty.

Modifications:

I have introduced a class (SocketUtils) that wraps operations
requiring SocketPermissions in doPrivileged blocks.

Result:

A user of Netty can grant SocketPermissions explicitly to the Netty
jar, without granting it to the rest of their application.
2017-01-19 21:23:28 +01:00
Norman Maurer
a2b8646b5f [maven-release-plugin] prepare for next development iteration 2017-01-12 13:25:14 +01:00
Norman Maurer
91a0bdc17a [maven-release-plugin] prepare release netty-4.0.43.Final 2017-01-12 13:05:33 +01:00
Norman Maurer
eff8413d9d Eliminate usage of releaseLater(...) to reduce memory usage during tests
Motiviation:

We used ReferenceCountUtil.releaseLater(...) in our tests which simplifies a bit the releasing of ReferenceCounted objects. The problem with this is that while it simplifies stuff it increase memory usage a lot as memory may not be freed up in a timely manner.

Modifications:

- Deprecate releaseLater(...)
- Remove usage of releaseLater(...) in tests.

Result:

Less memory needed to build netty while running the tests.
2016-11-18 11:21:23 +00:00
Norman Maurer
50a11d964d [maven-release-plugin] prepare for next development iteration 2016-10-14 14:32:28 +02:00
Norman Maurer
73306e017d [maven-release-plugin] prepare release netty-4.0.42.Final 2016-10-14 14:31:27 +02:00
Scott Mitchell
690f4aa44d SocketSslEchoTest failure
Motivation:
8ba5b5f740 removed some ciphers from the default list, and SocketSslEchoTest had one of these ciphers hard coded in the test. The test will fail if the cihper is not supported by default.

Modifications:
SocketSslEchoTest should ensure a cipher is used which will be supported by the peer

Result:
Test result no longer depends upon default cipher list.
2016-10-11 17:48:14 -07:00