d3ca087f6b
Motivation: There are 2 motivations, the first depends on the second: Loading Netty Epoll statically stopped working in 4.1.16, due to `Native` always loading the arch specific shared object. In a static binary, there is no arch specific SO. Second, there are a ton of exceptions that can happen when loading a native library. When loading native code, Netty tries a bunch of different paths but a failure in any given may not be fatal. Additionally: turning on debug logging is not always feasible so exceptions get silently swallowed. Modifications: * Change Epoll and Kqueue to try the static load second * Modify NativeLibraryLoader to record all the locations where exceptions occur. * Attempt to use `addSuppressed` from Java 7 if available. Alternatives Considered: An alternative would be to record log messages at each failure. If all load attempts fail, the log messages are printed as warning, else as debug. The problem with this is there is no `LogRecord` to create like in java.util.logging. Buffering the args to logger.log() at the end of the method loses the call site, and changes the order of events to be confusing. Another alternative is to teach NativeLibraryLoader about loading the SO first, and then the static version. This would consolidate the code fore Epoll, Kqueue, and TCNative. I think this is the long term better option, but this PR is changing a lot already. Someone else can take a crack at it later Results: Epoll Still Loads and easier debugging. |
||
---|---|---|
.github | ||
all | ||
bom | ||
buffer | ||
codec | ||
codec-dns | ||
codec-haproxy | ||
codec-http | ||
codec-http2 | ||
codec-memcache | ||
codec-mqtt | ||
codec-redis | ||
codec-smtp | ||
codec-socks | ||
codec-stomp | ||
codec-xml | ||
common | ||
dev-tools | ||
example | ||
handler | ||
handler-proxy | ||
license | ||
microbench | ||
resolver | ||
resolver-dns | ||
tarball | ||
testsuite | ||
testsuite-autobahn | ||
testsuite-osgi | ||
transport | ||
transport-native-epoll | ||
transport-native-kqueue | ||
transport-native-unix-common | ||
transport-native-unix-common-tests | ||
transport-rxtx | ||
transport-sctp | ||
transport-udt | ||
.fbprefs | ||
.gitignore | ||
.travis.yml | ||
CONTRIBUTING.md | ||
LICENSE.txt | ||
NOTICE.txt | ||
pom.xml | ||
README.md | ||
run-example.sh |
Netty Project
Netty is an asynchronous event-driven network application framework for rapid development of maintainable high performance protocol servers & clients.
Links
How to build
For the detailed information about building and developing Netty, please visit the developer guide. This page only gives very basic information.
You require the following to build Netty:
- Latest stable Oracle JDK 7
- Latest stable Apache Maven
- If you are on Linux, you need additional development packages installed on your system, because you'll build the native transport.
Note that this is build-time requirement. JDK 5 (for 3.x) or 6 (for 4.0+) is enough to run your Netty-based application.
Branches to look
Development of all versions takes place in each branch whose name is identical to <majorVersion>.<minorVersion>
. For example, the development of 3.9 and 4.0 resides in the branch '3.9' and the branch '4.0' respectively.