bareos: master d594cd8a
Author | Committer | Branch | Timestamp | Parent | |
---|---|---|---|---|---|
franku | franku | master | 2019-08-27 19:28 | master 7cd50650 | Pending |
Affected Issues | 0000385: bareos daemon stop restart hang if bareos-tray-monitor is connected | ||||
Changeset | workq: refactor code or remove unneded code for worker threads fixes 0000385: bareos daemon stop restart hang if bareos-tray-monitor is connected The functionality was overengineered and did not do what it probably should do. The names workq or workqueue did not explain what the code actually did and it was not reliable. Therefore refactored the complete code: - ThreadList is now a class that contains the calls to create worker-threads who will call a pre-defined handler routine - ThreadListPrivate contains the implementation and is hidden from the public interface - using ThreadList with RAII in the daemon code, accordingly - the new functionality consists mainly of a list where new threads are added to, therefore the name of all files and variables are changed into names containing "thread list" or similar - used std::thread instead of pthread - used std::set instead of a linked list - worker threads start detached and cleanup resources by themself - removed or renamed variables - removed unused code in the thread start and at the end - previous return type of int was not used as intended, therefore a simple bool is enough - upon shutdown threads are not joined but the parent thread will wait until the thread list is empty or a timeout occurs - added a user callback for each worker-thread that is called from the parent thread before it enters the waiting state - ua_server: close user_agent_socket only in FreeUaContext - synchronize shutdown of worker threads on daemon shutdown - updated code that calls the new functions accordingly - fd and dir: added a worker-thread shutdown handler to each socket server - sd: do not cleanup jcr memory of a console connection in the terminate handler - dird: StopSocketServer is now called before StopWatchdog so socket operations still can time out - set the timeout for the second call of SSL_shutdown from 120 seconds to 2 seconds as this makes director shutdown faster - added a unit test |
||||
mod - core/src/dird/dird.cc | Diff File | ||||
mod - core/src/dird/jobq.cc | Diff File | ||||
mod - core/src/dird/socket_server.cc | Diff File | ||||
mod - core/src/dird/ua_server.cc | Diff File | ||||
mod - core/src/filed/socket_server.cc | Diff File | ||||
mod - core/src/include/jcr.h | Diff File | ||||
mod - core/src/lib/CMakeLists.txt | Diff File | ||||
mod - core/src/lib/bnet_server_tcp.cc | Diff File | ||||
mod - core/src/lib/bnet_server_tcp.h | Diff File | ||||
mod - core/src/lib/lib.h | Diff File | ||||
add - core/src/lib/thread_list.cc | Diff File | ||||
add - core/src/lib/thread_list.h | Diff File | ||||
mod - core/src/lib/tls_openssl.cc | Diff File | ||||
rm - core/src/lib/workq.cc | Diff File | ||||
rm - core/src/lib/workq.h | Diff File | ||||
mod - core/src/stored/ndmp_tape.cc | Diff File | ||||
mod - core/src/stored/socket_server.cc | Diff File | ||||
mod - core/src/stored/stored.cc | Diff File | ||||
mod - core/src/tests/CMakeLists.txt | Diff File | ||||
add - core/src/tests/thread_list.cc | Diff File |