From 4a9b0b9dfddb8adae9e34e3b39fdd2359b6b3091 Mon Sep 17 00:00:00 2001 From: Benjamin Sergeant Date: Sun, 23 Feb 2020 09:44:58 -0800 Subject: [PATCH] (server) give thread name to some usual worker threads / unittest is broken !! --- .github/workflows/ccpp.yml | 2 +- docs/CHANGELOG.md | 4 ++++ ixwebsocket/IXSocketServer.cpp | 5 +++++ ixwebsocket/IXWebSocketServer.cpp | 3 +++ 4 files changed, 13 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ccpp.yml b/.github/workflows/ccpp.yml index c79fa69f..6ed44c76 100644 --- a/.github/workflows/ccpp.yml +++ b/.github/workflows/ccpp.yml @@ -1,4 +1,4 @@ -name: C/C++ CI +name: unittest on: [push] diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index ebedb62c..c60e0f33 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -1,6 +1,10 @@ # Changelog All changes to this project will be documented in this file. +## [8.1.5] - 2020-02-23 + +(server) give thread name to some usual worker threads / unittest is broken !! + ## [8.1.4] - 2020-02-22 (websocket server) fix regression from 8.1.2, where per-deflate message compression was always disabled diff --git a/ixwebsocket/IXSocketServer.cpp b/ixwebsocket/IXSocketServer.cpp index c2bd4b10..8eecab0f 100644 --- a/ixwebsocket/IXSocketServer.cpp +++ b/ixwebsocket/IXSocketServer.cpp @@ -7,6 +7,7 @@ #include "IXSocketServer.h" #include "IXNetSystem.h" +#include "IXSetThreadName.h" #include "IXSocket.h" #include "IXSocketConnect.h" #include "IXSocketFactory.h" @@ -247,6 +248,8 @@ namespace ix // Set the socket to non blocking mode, so that accept calls are not blocking SocketConnect::configure(_serverFd); + setThreadName("SocketServer::listen"); + for (;;) { if (_stop) return; @@ -347,6 +350,8 @@ namespace ix void SocketServer::runGC() { + setThreadName("SocketServer::GC"); + for (;;) { // Garbage collection to shutdown/join threads for closed connections. diff --git a/ixwebsocket/IXWebSocketServer.cpp b/ixwebsocket/IXWebSocketServer.cpp index 36104f06..ede04c30 100644 --- a/ixwebsocket/IXWebSocketServer.cpp +++ b/ixwebsocket/IXWebSocketServer.cpp @@ -7,6 +7,7 @@ #include "IXWebSocketServer.h" #include "IXNetSystem.h" +#include "IXSetThreadName.h" #include "IXSocketConnect.h" #include "IXWebSocket.h" #include "IXWebSocketTransport.h" @@ -73,6 +74,8 @@ namespace ix void WebSocketServer::handleConnection(std::shared_ptr socket, std::shared_ptr connectionState) { + setThreadName("WebSocketServer::" + connectionState->getId()); + auto webSocket = std::make_shared(); _onConnectionCallback(webSocket, connectionState);