Closed vignessh closed 9 years ago
I see this too, basically not quite obvious where the bug is rx-netty or jersey bridge, but in essence scheduler threads created here:
ThreadWorker get() {
while (!expiringWorkerQueue.isEmpty()) {
ThreadWorker threadWorker = expiringWorkerQueue.poll();
if (threadWorker != null) {
return threadWorker;
}
}
// No cached worker found, so create a new one.
return new ThreadWorker(WORKER_THREAD_FACTORY);
}
not release in here:
void release(ThreadWorker threadWorker) {
// Refresh expire time before putting worker back in pool
threadWorker.setExpirationTime(now() + keepAliveTime);
expiringWorkerQueue.offer(threadWorker);
}
due to missing unsubscribe.
adding any interceptors will workaround the problem, this is a really nasty bug, as it leaks 1 thread per request.
This was fixed by #200
I was trying to run some kind of micro benchmark against Karyon to understand how it performs - for that purpose I checked out the Karyon source code and ran
../gradlew runJerseyHelloNOSS
from the karyon-examples folder.And then proceeded to run
wrk -d 1s http://localhost:8888/hello/
in a separate terminal. This ran fine without any failures. After which, I commented out a couple of lines from JerseyHelloWorldApp to make it look like below:Basically commented out the interceptor and authentication bindings. I ran
wrk -d 1s http://localhost:8888/hello/
against this change, and got the stack trace as below:If I uncomment the above said lines, I'm able to run wrk against the service with no failures. How does the addition of interceptor make the service more stable?