add simpler way to set the epoll bug workaround flag for netty

This commit is contained in:
Shay Banon 2012-09-22 19:50:43 +02:00
parent f73d684c76
commit df0ff176d4
2 changed files with 9 additions and 0 deletions

View File

@ -112,6 +112,11 @@ public class NettyHttpServerTransport extends AbstractLifecycleComponent<HttpSer
public NettyHttpServerTransport(Settings settings, NetworkService networkService) { public NettyHttpServerTransport(Settings settings, NetworkService networkService) {
super(settings); super(settings);
this.networkService = networkService; this.networkService = networkService;
if (settings.getAsBoolean("netty.epollBugWorkaround", false)) {
System.setProperty("org.jboss.netty.epollBugWorkaround", "true");
}
ByteSizeValue maxContentLength = componentSettings.getAsBytesSize("max_content_length", settings.getAsBytesSize("http.max_content_length", new ByteSizeValue(100, ByteSizeUnit.MB))); ByteSizeValue maxContentLength = componentSettings.getAsBytesSize("max_content_length", settings.getAsBytesSize("http.max_content_length", new ByteSizeValue(100, ByteSizeUnit.MB)));
this.maxChunkSize = componentSettings.getAsBytesSize("max_chunk_size", settings.getAsBytesSize("http.max_chunk_size", new ByteSizeValue(8, ByteSizeUnit.KB))); this.maxChunkSize = componentSettings.getAsBytesSize("max_chunk_size", settings.getAsBytesSize("http.max_chunk_size", new ByteSizeValue(8, ByteSizeUnit.KB)));
this.maxHeaderSize = componentSettings.getAsBytesSize("max_header_size", settings.getAsBytesSize("http.max_header_size", new ByteSizeValue(8, ByteSizeUnit.KB))); this.maxHeaderSize = componentSettings.getAsBytesSize("max_header_size", settings.getAsBytesSize("http.max_header_size", new ByteSizeValue(8, ByteSizeUnit.KB)));

View File

@ -163,6 +163,10 @@ public class NettyTransport extends AbstractLifecycleComponent<Transport> implem
this.threadPool = threadPool; this.threadPool = threadPool;
this.networkService = networkService; this.networkService = networkService;
if (settings.getAsBoolean("netty.epollBugWorkaround", false)) {
System.setProperty("org.jboss.netty.epollBugWorkaround", "true");
}
this.connectMutex = new Object[500]; this.connectMutex = new Object[500];
for (int i = 0; i < connectMutex.length; i++) { for (int i = 0; i < connectMutex.length; i++) {
connectMutex[i] = new Object(); connectMutex[i] = new Object();