We're updating the issue view to help you get more done. 

Protocol Logger Thread is not destroyed after deleting session

Description

1) Create a server session and added it to the session manager. I've switched on Logs and Protocol Logs.
2) Send some messages using a dummy client (OPTIONAL: This is just for the sake of simulating some operation between session and the client)
3) Disconnect the client.

Observation:
While noticing the threads spawned and destroyed, I've found out that even though the Log thread is being destroyed, the Protocol Logging thread is never destroyed (It goes to a "zombie thread" state).

Proposed FIX:

Bar.java

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 144 //------------------------------------------------------------------------------------------------- 145 Session::~Session() 146 { 147 log("Session terminating"); 148 if (_logger) 149 _logger->stop(); 150 hypersleep<h_seconds>(1); // needed for service threads to exit gracefully 151 152 if (_connection && _connection->get_role() == Connection::cn_acceptor) 153 { f8_scoped_spin_lock guard(_per_spl); delete _persist; _persist = 0; } 154 delete _schedule; 155 } 156 If you look at the lines 148 and 149, The logger has been stopped successfully in the destructor, However, There's no attempt made to destroy the _plogger. Therefore I think the code should revised for, 144 //------------------------------------------------------------------------------------------------- 145 Session::~Session() 146 { 147 log("Session terminating"); 148 if (_logger) 149 _logger->stop(); //TODO: Add this portion of code if (_plogger) _plogger->stop(); 150 hypersleep<h_seconds>(1); // needed for service threads to exit gracefully 151 152 if (_connection && _connection->get_role() == Connection::cn_acceptor) 153 { f8_scoped_spin_lock guard(_per_spl); delete _persist; _persist = 0; } 154 delete _schedule; 155 } 156

Environment

None

Status

Assignee

David Dight

Reporter

Akila Jay

Labels

Branch

master

Products

None

Components

Fix versions

Affects versions

1.2.0

Priority

Major