Details
-
Bug
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
None
-
None
-
None
Description
Reproduction steps
- Set 'ListenTCPRecord.Read Timeout' property to manageable value (like 120 second)
- Start ListenTCPRecord, listen on port XXX
- telnet HOST XXX (This will open and keep a connection to that port)
- Stop ListenTCPRecord while connection is open (After that, notice the 2 active threads on the processor)
- Terminate ListenTCPRecord
- Now any process (be it ListenTCPRecord or ListenTCP) that tries to listen on port XXX will report an "Address already in use" error
Root cause
ListenTCPRecord is trying to do cleanup in an @OnStopped method. The problem is that these methods won't be called while there are still running worker threads. When the processor is terminated, it eliminates the cleanup thread as well, so the cleanup never happens.
ListenTCP for example doesn't exhibit this issue because its cleanup method is not annotated with @OnStopped but with @OnUnscheduled.
Fix
The solution is fairly simple: we just need to annotate the ListenTCPRecord cleanup method with @OnUnscheduled instead of @OnStopped.
Attachments
Issue Links
- links to