# HG changeset patch # User Alain Mazy # Date 1783005647 -7200 # Node ID 0e6a65731bbc553cb66c14c3fe096ee75b9f7db7 # Parent 58018d5883d119a24689bbdd61c290c7582659bf use different thread names in the multitenant DicomServer diff -r 58018d5883d1 -r 0e6a65731bbc OrthancFramework/Sources/DicomNetworking/DicomServer.cpp --- a/OrthancFramework/Sources/DicomNetworking/DicomServer.cpp Thu Jul 02 16:34:16 2026 +0200 +++ b/OrthancFramework/Sources/DicomNetworking/DicomServer.cpp Thu Jul 02 17:20:47 2026 +0200 @@ -63,7 +63,7 @@ unsigned int maximumPduLength, bool useDicomTls) { - Logging::ScopedThreadNameSetter setter("DICOM-SERVER"); + Logging::ScopedThreadNameSetter setter(server->name_); CLOG(INFO, DICOM) << "DICOM server started"; while (server->continue_) @@ -90,12 +90,15 @@ } - DicomServer::DicomServer() : + DicomServer::DicomServer(const std::string& name, + const std::string& dicomThreadNamesPrefix) : pimpl_(new PImpl), checkCalledAet_(true), aet_("ANY-SCP"), port_(104), continue_(false), + name_(name), + dicomThreadNamesPrefix_(dicomThreadNamesPrefix), associationTimeout_(30), threadsCount_(4), modalities_(NULL), @@ -436,11 +439,11 @@ if (metricsRegistry_ == NULL) { - pimpl_->workers_.reset(new RunnableWorkersPool(threadsCount_, "DICOM-")); + pimpl_->workers_.reset(new RunnableWorkersPool(threadsCount_, dicomThreadNamesPrefix_ + "-")); } else { - pimpl_->workers_.reset(new RunnableWorkersPool(threadsCount_, "DICOM-", *metricsRegistry_, "orthanc_available_dicom_threads")); + pimpl_->workers_.reset(new RunnableWorkersPool(threadsCount_, dicomThreadNamesPrefix_ + "-", *metricsRegistry_, "orthanc_available_dicom_threads")); } pimpl_->thread_ = boost::thread(ServerThread, this, maximumPduLength_, useDicomTls_); diff -r 58018d5883d1 -r 0e6a65731bbc OrthancFramework/Sources/DicomNetworking/DicomServer.h --- a/OrthancFramework/Sources/DicomNetworking/DicomServer.h Thu Jul 02 16:34:16 2026 +0200 +++ b/OrthancFramework/Sources/DicomNetworking/DicomServer.h Thu Jul 02 17:20:47 2026 +0200 @@ -75,6 +75,8 @@ std::string aet_; uint16_t port_; bool continue_; + std::string name_; + std::string dicomThreadNamesPrefix_; uint32_t associationTimeout_; unsigned int threadsCount_; IRemoteModalities* modalities_; @@ -102,7 +104,8 @@ bool useDicomTls); public: - DicomServer(); + DicomServer(const std::string& name, + const std::string& dicomThreadNamesPrefix); ~DicomServer(); diff -r 58018d5883d1 -r 0e6a65731bbc OrthancServer/Plugins/Samples/MultitenantDicom/MultitenantDicomServer.cpp --- a/OrthancServer/Plugins/Samples/MultitenantDicom/MultitenantDicomServer.cpp Thu Jul 02 16:34:16 2026 +0200 +++ b/OrthancServer/Plugins/Samples/MultitenantDicom/MultitenantDicomServer.cpp Thu Jul 02 17:20:47 2026 +0200 @@ -93,7 +93,7 @@ labelsStoreLevels_.insert(Orthanc::ResourceType_Instance); } - server_.reset(new Orthanc::DicomServer); + server_.reset(new Orthanc::DicomServer("MULTI-DCM-SERVER", "MULTI-DCM")); { OrthancPlugins::OrthancConfiguration globalConfig; diff -r 58018d5883d1 -r 0e6a65731bbc OrthancServer/Sources/main.cpp --- a/OrthancServer/Sources/main.cpp Thu Jul 02 16:34:16 2026 +0200 +++ b/OrthancServer/Sources/main.cpp Thu Jul 02 17:20:47 2026 +0200 @@ -1380,7 +1380,7 @@ ModalitiesFromConfiguration modalities; // Setup the DICOM server - DicomServer dicomServer; + DicomServer dicomServer("DICOM-SERVER", "DICOM-"); dicomServer.SetMetricsRegistry(context.GetMetricsRegistry()); dicomServer.SetRemoteModalities(modalities); dicomServer.SetStoreRequestHandlerFactory(serverFactory);