From 3b89fc9e7ba5d84bd193d4ed9079171371f33cab Mon Sep 17 00:00:00 2001 From: Piotr Konopka Date: Wed, 25 Nov 2026 17:26:45 +0100 Subject: [PATCH] Fix wrong use of lockfree queue It is not OK anymore to call the queue's contructor without an initial size. By default, it is still variable-size, so it will grow as needed. Fixes OCTRL-1083. Assisted by Claude Sonnet 5.5 --- occ/occlib/OccServer.cxx | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/occ/occlib/OccServer.cxx b/occ/occlib/OccServer.cxx index 48c240956..dea82df44 100644 --- a/occ/occlib/OccServer.cxx +++ b/occ/occlib/OccServer.cxx @@ -23,10 +23,6 @@ * Intergovernmental Organization or submit itself to any jurisdiction. */ -#define BOOST_NO_CXX20_HDR_CONCEPTS // TODO: David Rohr: Fix the - // boost::lockfree::queue, must - // not use trivial constructor!!! - #include "OccServer.h" #include "util/Defer.h" @@ -71,7 +67,7 @@ grpc::Status OccServer::EventStream(grpc::ServerContext* context, boost::uuids::basic_random_generator gen; std::string id = boost::uuids::to_string(gen()); - boost::lockfree::queue eventQueue; + boost::lockfree::queue eventQueue(16); // 16 is the initial size, the queue grows on demand m_eventQueues[id] = &eventQueue; DEFER({ m_eventQueues.erase(id); @@ -106,7 +102,7 @@ grpc::Status OccServer::StateStream(grpc::ServerContext* context, boost::uuids::basic_random_generator gen; std::string id = boost::uuids::to_string(gen()); - boost::lockfree::queue stateQueue; + boost::lockfree::queue stateQueue(16); // 16 is the initial size, the queue grows on demand m_stateQueues[id] = &stateQueue; DEFER({ m_stateQueues.erase(id);