facebookarchive / nifty

Thrift on Netty

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

nifty server leaks timers

hgschmie opened this issue · comments

The ThriftServerModule binds a nifty timer out of a Provides method:

@Provides
@ThriftServerTimer
@Singleton
public Timer getThriftServerTimer()
{
    return new NiftyTimer("thrift");
}

and the Timer is annotated with @PreDestroy. However, it gets never hooked in the lifecycle and therefore when the server is shut down, it leaks its timer. This is not a big deal for an actual server but for Unit tests which start and stop a lot of services, they accumulate timers (and associated resources).

Thank you for reaching out to us and we'd like to first apoligize for not getting back to you sooner. We're closing out older issues since updates to the project may address the issue you opened or they may no longer be relevant. If you're still experiencing the problem, please reopen the issue - thanks!