Closed vbnetvbnet closed 7 years ago
Try calling Modbus.releaseSharedResources()
.
If that's not enough, you may have to convince Netty to release some as well:
InternalThreadLocalMap.destroy()
FastThreadLocal.removeAll()
Thanks, but this still doesn't work. I'm gonna try some other methods tomorrow.
I have an open issue with Netty that may be causing this: https://github.com/netty/netty/issues/6565
Great! I 'll keep tuned.
@kevinherron I tested again carefully and fortunately it worked, by calling Modbus.releaseSharedResources()
alone. But I have to add Thread.sleep(3000)
because Tomcat doesn't wait subtasks to complete.
Here is what has caused this problem. I called this method in a WriteSingleRegisterRequest. But the server just write the value and has no response(WriteSingleRegisterResponse) data at all. In this case, the future.thenAccept(response -> {...});
will never be called. And it just wait.
When I shutdown Tomcat server, it failed to close modbus related resources. Here is the error report:
Could you take a look and tell me which methods should I call when shutting down my Tomcat server, thread pool#shutdown() or future#close() or something else? Thanks.