-
Jon Olav Hauglid authored
The problem was a thread handle resource leakage when creating threads for handling connections on Windows. This could lead to Windows servers eventually running out of handles. This was a regression introduced in 5.7 by WL#6407. In this WL we added support for joining threads on Windows in order to do proper thread cleanup during shutdown. In order to do this we had to keep the thread handle open as it is needed for joining the thread. The bug was that the handle was kept open also for threads that are detached. Such threads are never joined and thus the handle was not closed until the server terminated. The (by far) most common type of thread which is detached, is threads for handling connections. This patch fixes the problem by closing thread handles right after thread creation if the thread is created as a detached thread.
Jon Olav Hauglid authoredThe problem was a thread handle resource leakage when creating threads for handling connections on Windows. This could lead to Windows servers eventually running out of handles. This was a regression introduced in 5.7 by WL#6407. In this WL we added support for joining threads on Windows in order to do proper thread cleanup during shutdown. In order to do this we had to keep the thread handle open as it is needed for joining the thread. The bug was that the handle was kept open also for threads that are detached. Such threads are never joined and thus the handle was not closed until the server terminated. The (by far) most common type of thread which is detached, is threads for handling connections. This patch fixes the problem by closing thread handles right after thread creation if the thread is created as a detached thread.
Loading