Commit Graph

253 Commits

Author SHA1 Message Date
Norman Maurer
e48bc9c086 [#1344] Fix race condition in DefaultChannelPromise / DefaultChannelProgressivePromise which could lead to listeners that are not notified 2013-05-08 10:14:28 +02:00
Norman Maurer
d8a250aba0 Log with info level and not with warn 2013-05-02 08:43:29 +02:00
Trustin Lee
1e0c83db23 Introduce AddressedEnvelope message type for generic representation of an addressed message
- Fixes #1282 (not perfectly, but to the extent it's possible with the current API)
- Add AddressedEnvelope and DefaultAddressedEnvelope
- Make DatagramPacket extend DefaultAddressedEnvelope<ByteBuf, InetSocketAddress>
- Rename ByteBufHolder.data() to content() so that a message can implement both AddressedEnvelope and ByteBufHolder (DatagramPacket does) without introducing two getter methods for the content
- Datagram channel implementations now understand ByteBuf and ByteBufHolder as a message with unspecified remote address.
2013-05-01 17:04:43 +09:00
Trustin Lee
bc96c4b7b3 Fix a bug where SingleThreadEventExecutor sets its internal state flag too early during termination 2013-05-01 16:56:34 +09:00
Trustin Lee
23d0178494 Introduce EventExecutor.shutdownGracefully() that deprecates shutdown()
shutdownGracefully() provides two optional parameters that give more
control over when an executor has to be shut down.

- Related issue: #1307
- Add shutdownGracefully(..) and isShuttingDown()
- Deprecate shutdown() / shutdownNow()
- Replace lastAccessTime with lastExecutionTime and update it after task
  execution for accurate quiet period check
  - runAllTasks() and runShutdownTasks() update it automatically.
  - Add updateLastExecutionTime() so that subclasses can update it
- Add a constructor parameter that tells not to add an unncessary wakeup
  task in execute() if addTask() wakes up the executor thread
  automatically.  Previously, execute() always called wakeup() after
  addTask(), which often caused an extra dummy task in the task queue.
- Use shutdownGracefully() wherever possible / Deprecation javadoc
- Reduce the running time of SingleThreadEventLoopTest from 40s to 15s
  using custom graceful shutdown parameters

- Other changes made along with this commit:
  - takeTask() does not throw InterruptedException anymore.
    - Returns null on interruption or wakeup
  - Make sure runShutdownTasks() return true even if an exception was
    raised while running the shutdown tasks
  - Remove unnecessary isShutdown() checks
  - Consistent use of SingleThreadEventExecutor.nanoTime()

Replace isWakeupOverridden with a constructor parameter
2013-05-01 10:52:38 +09:00
Trustin Lee
8a4e708847 Fix 'unsupported address type error' in UDP tests / Fix checkstyle 2013-04-24 17:43:32 +09:00
Trustin Lee
cee0dc6f81 Add IPv4 and IPv6 specific localhost constants to NetUtil 2013-04-24 17:32:42 +09:00
Trustin Lee
c37b53fdd1 Format code 2013-04-24 11:33:19 +09:00
Trustin Lee
656d7ca054 Improve localhost / local interface detection mechanism in NetUtil
- Do not attempt to validate localhost by binding a socket because it can fail when SecurityManager is in use
- Find loopback interface first and get address from there instead of getting loopback address from InetAddress.getLocalHost() (because it's more reliable)
- Instead of throwing an Error, just log and fall back to 127.0.0.1 while determining localhost address
2013-04-24 11:28:42 +09:00
Trustin Lee
b5989e2449 Reduce exception instantiation overhead in SslHandler / Reduce unnecessary empty array creation
- Added EmptyArrays as an internal utility class
2013-04-24 09:32:53 +09:00
Trustin Lee
7452d05fa6 Add some logging for easier diagnosis in NetUtil
.. + formatting
2013-04-23 22:57:29 +09:00
Trustin Lee
be1426a220 Fix incorrect log level in NetUtil 2013-04-23 22:53:26 +09:00
Norman Maurer
9a5f45a0c1 [#1297] Make sure ResourceLeakDetector.open(...) is only used after constructing was successful 2013-04-22 10:07:22 +02:00
Trustin Lee
6bb00cea6f Fix failures in testsuite-osgi-deps
- Make only netty-common depend on javassist at compile scope, and
  all others at test scope
2013-04-19 05:57:53 +09:00
Trustin Lee
7ee571968c Use progress + total instead of delta
.. because there is sometimes a task whose total is only a rough
estimation
2013-04-15 20:11:02 +09:00
Trustin Lee
e69033a4c3 Replace TransferFuture(Listener) with (Channel)ProgressiveFuture(Listener)
- Now works without the transport package
- Renamed TransferFuture to ProgressiveFuture and ChannelProgressiveFuture / same for promises
- ProgressiveFutureListener now extends GenericProgressiveFutureListener and GenericFutureListener (add/removeTransferListener*() were removed)
- Renamed DefaultEventListeners to DefaultFutureListeners and only accept GenericFutureListeners
- Various clean-up
2013-04-15 15:26:20 +09:00
Trustin Lee
391c011764 Renames and typos 2013-04-15 11:03:59 +09:00
kerr
713b200adf [#1244] Support ChannelTransferPromise for sendFile 2013-04-14 21:22:03 +02:00
Trustin Lee
2600f46fd7 Fix checkstyle 2013-04-11 17:54:20 +09:00
Trustin Lee
15ac4127e4 Remove @Ignore and add expected / Fix inspector warnings 2013-04-11 17:29:37 +09:00
Norman Maurer
73db1f886d [#1247] Add test which shows the problem with concrete classes that pass in the type based on a generic 2013-04-10 07:08:42 +02:00
Trustin Lee
e8ee6a2772 Better exception message when tickDuration is too big
- Related: #1246
- Fix misc inspector warnings
2013-04-10 13:44:05 +09:00
Norman Maurer
da174f4290 Add a warning about SingleThreadEventExecutor.pendingTasks() operation 2013-04-09 12:50:29 +02:00
Norman Maurer
0efebd5a82 Allow to get an Iterator over all of the EventExecutor an EventExecutorGroup contains. Beside this allow to get basic stats for the EventExecutor like pendingTasks and executorCount 2013-04-09 15:45:18 +09:00
Norman Maurer
60cfb547b4 Fix logging of android platform detection 2013-04-08 21:19:20 +02:00
Norman Maurer
51de21f250 [#1246] Correctly convert to nanos 2013-04-08 10:42:54 +02:00
Norman Maurer
2508c76e97 [#1246] Fix cpu-spinning regression in HashedWheelTimer
Also remove the usage of System.currentTimeMillis() completely here to make it more consistent and correct
2013-04-08 07:01:08 +02:00
Andrei Pozolotin
a3e760a003 fix #1234 - duplicate package-info.java errors in eclipse requires release of netty-build v 19 and netty-parent update. 2013-04-05 05:38:05 +09:00
Trustin Lee
05bc0ba17f Fix checkstyle 2013-04-04 16:47:10 +09:00
Trustin Lee
6dfa455f9e Fix compiler warnings 2013-04-04 16:31:41 +09:00
Trustin Lee
117ad8acd7 Add MultithreadEventLoopGroup.DEFAULT_EVENT_LOOP_THREADS / Add DefaultThreadFactory
- Allow overriding the default thread factory when a user specified no thread factory
2013-04-03 17:49:30 +09:00
Trustin Lee
312a35dfed Remove MultithreadEventExecutorGroup.DEFAULT_POOL_SIZE
- We should never define a default nThread for MultithreadEventExecutorGroup because we don't know what a user do with it.
2013-04-03 17:15:25 +09:00
Trustin Lee
2ffa083d3c Allow overriding the default allocator properties and log them / Prettier log 2013-04-03 12:08:01 +09:00
Trustin Lee
0f3dc0409a Log various properties at startup time for easier diagnosis 2013-04-03 11:44:30 +09:00
Norman Maurer
96bf71e814 Let EventExecutorGroup extend ScheduledExecutorService as it shares quite some semantic 2013-04-01 13:56:46 +02:00
Prajwal Tuladhar
05850da863 enable checkstyle for test source directory and fix checkstyle errors 2013-03-30 13:18:57 +01:00
Norman Maurer
59012390f6 Fix version numbering 2013-03-25 08:01:11 +01:00
Norman Maurer
7d7b676eeb [maven-release-plugin] prepare for next development iteration 2013-03-22 15:20:35 +01:00
Norman Maurer
60fc7dac4d [maven-release-plugin] prepare release netty-4.0.0.CR1 2013-03-22 15:20:11 +01:00
Prajwal Tuladhar
915cb8b55c [#744] Port fixes from Akka to HashedWheelTimer
port fix from Akka with following commits:
*
https://github.com/akka/akka/commit/cb4e3536b0ed3483bd3636d7789c0ddcadaf
a2da
*
https://github.com/akka/akka/commit/7e590f3071bdf89a4aa9d7d262bac8923d85
e754

And also use constants for worker state for time instead of numeric.
2013-03-22 12:26:15 +01:00
Norman Maurer
624bda4695 Make sure cancelled scheduled tasks will not run again if cancelled before 2013-03-22 08:13:21 +01:00
Trustin Lee
19ffdd5c29 Revamp the selector auto rebuild checker
- Count the number of select() calls made to wait until reaching at the expected dead line, and rebuild selectors if too many select() calls were made.
2013-03-22 14:33:47 +09:00
Trustin Lee
fa02ffddae Remove TaskScheduler and ImmediateEventExecutor that requires TaskScheduler
- Related issue: #817
2013-03-22 09:06:08 +09:00
Trustin Lee
4097dee49d Make SingleThreadEventExecutor independent from TaskScheduler
- Related issue: #817
2013-03-22 09:00:38 +09:00
Trustin Lee
cfa2f72681 Fix checkstyle 2013-03-21 19:01:53 +09:00
Trustin Lee
a980638190 Ensure the best effort is made even if future listeners could not be notified / Handle registration failure in a robust manner
- Related: #1187
2013-03-21 17:48:10 +09:00
Trustin Lee
8b722d29a7 Add constructor parameters that do not perform type parameter auto-detection for the languages without type parameters
- Fixes #1177
- Add TypeParameterMatcher.get(parameterType)
- Add alternative constructors
2013-03-21 16:11:47 +09:00
Norman Maurer
ce87b627be Let EventExecutor return our Future to allow the user to work also with FutureListener here. Also add a special ScheduledFuture that extends our Future for this purpose. 2013-03-19 10:45:42 +01:00
Trustin Lee
2a87950784 [maven-release-plugin] prepare for next development iteration 2013-03-16 18:41:36 +09:00
Trustin Lee
adfb29330b [maven-release-plugin] prepare release netty-4.0.0.Beta3 2013-03-16 18:40:59 +09:00