From 4f561b17cfbb038c9ab01364db49ed75bad6124a Mon Sep 17 00:00:00 2001 From: Stefan Boberg Date: Tue, 20 Feb 2024 22:00:19 +0100 Subject: adding context to http.sys error message added some context to http.sys API call error reporting --- src/zenhttp/servers/httpsys.cpp | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) (limited to 'src/zenhttp/servers/httpsys.cpp') diff --git a/src/zenhttp/servers/httpsys.cpp b/src/zenhttp/servers/httpsys.cpp index 5cd273c40..4b812a127 100644 --- a/src/zenhttp/servers/httpsys.cpp +++ b/src/zenhttp/servers/httpsys.cpp @@ -524,7 +524,7 @@ HttpMessageResponseRequest::HandleCompletion(ULONG IoResult, ULONG_PTR NumberOfB if (IoResult != NO_ERROR) { - ZEN_WARN("response aborted due to error: '{}'", GetSystemErrorAsString(IoResult)); + ZEN_WARN("response aborted due to error: {}", GetSystemErrorAsString(IoResult)); // if one transmit failed there's really no need to go on return nullptr; @@ -876,7 +876,7 @@ HttpAsyncWorkRequest::AsyncWorkItem::Execute() catch (std::exception& Ex) { return (void)Tx.IssueNextRequest( - new HttpMessageResponseRequest(Tx, 500, fmt::format("Exception thrown in async work: '{}'", Ex.what()))); + new HttpMessageResponseRequest(Tx, 500, fmt::format("Exception thrown in async work: {}", Ex.what()))); } } @@ -1483,11 +1483,11 @@ HttpSysTransaction::IssueNextRequest(HttpSysRequestHandler* NewCompletionHandler return true; } - ZEN_WARN("IssueRequest() failed: '{}'", ErrorCode.message()); + ZEN_WARN("IssueRequest() failed: {}", ErrorCode.message()); } catch (std::exception& Ex) { - ZEN_ERROR("exception caught in IssueNextRequest(): '{}'", Ex.what()); + ZEN_ERROR("exception caught in IssueNextRequest(): {}", Ex.what()); } // something went wrong, no request is pending @@ -1826,7 +1826,17 @@ InitialRequestHandler::IssueRequest(std::error_code& ErrorCode) ErrorCode = MakeErrorCode(HttpApiResult); - ZEN_WARN("HttpReceiveHttpRequest failed, error: '{}'", ErrorCode.message()); + if (IsInitialRequest()) + { + ZEN_WARN("initial HttpReceiveHttpRequest failed, error: {}", ErrorCode.message()); + } + else + { + ZEN_WARN("HttpReceiveHttpRequest (offset: {}, content-length: {}) failed, error: {}", + m_CurrentPayloadOffset, + m_PayloadBuffer.GetSize(), + ErrorCode.message()); + } return; } -- cgit v1.2.3 From 12b7bf1c16f671c83840961c37a339141a7ffbb3 Mon Sep 17 00:00:00 2001 From: Dan Engelbrecht Date: Thu, 4 Apr 2024 14:32:40 +0200 Subject: improved assert (#37) - Improvement: Add file and line to ASSERT exceptions - Improvement: Catch call stack when throwing assert exceptions and log/output call stack at important places to provide more context to caller --- src/zenhttp/servers/httpsys.cpp | 24 +++++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-) (limited to 'src/zenhttp/servers/httpsys.cpp') diff --git a/src/zenhttp/servers/httpsys.cpp b/src/zenhttp/servers/httpsys.cpp index 4b812a127..2b97e3f25 100644 --- a/src/zenhttp/servers/httpsys.cpp +++ b/src/zenhttp/servers/httpsys.cpp @@ -873,7 +873,12 @@ HttpAsyncWorkRequest::AsyncWorkItem::Execute() new HttpMessageResponseRequest(Tx, 500, "Response generated but no request handler scheduled"sv)); } } - catch (std::exception& Ex) + catch (const AssertException& AssertEx) + { + return (void)Tx.IssueNextRequest( + new HttpMessageResponseRequest(Tx, 500, fmt::format("Assert thrown in async work: '{}", AssertEx.FullDescription()))); + } + catch (const std::exception& Ex) { return (void)Tx.IssueNextRequest( new HttpMessageResponseRequest(Tx, 500, fmt::format("Exception thrown in async work: {}", Ex.what()))); @@ -1485,7 +1490,11 @@ HttpSysTransaction::IssueNextRequest(HttpSysRequestHandler* NewCompletionHandler ZEN_WARN("IssueRequest() failed: {}", ErrorCode.message()); } - catch (std::exception& Ex) + catch (const AssertException& AssertEx) + { + ZEN_ERROR("Assert thrown in IssueNextRequest(): {}", AssertEx.FullDescription()); + } + catch (const std::exception& Ex) { ZEN_ERROR("exception caught in IssueNextRequest(): {}", Ex.what()); } @@ -1995,7 +2004,12 @@ InitialRequestHandler::HandleCompletion(ULONG IoResult, ULONG_PTR NumberOfBytesT // Unable to route return new HttpMessageResponseRequest(Transaction(), 404, "No suitable route found"sv); } - catch (std::system_error& SystemError) + catch (const AssertException& AssertEx) + { + ZEN_ERROR("Caught assert exception while handling request: {}", AssertEx.FullDescription()); + return new HttpMessageResponseRequest(Transaction(), (uint16_t)HttpResponseCode::InternalServerError, AssertEx.FullDescription()); + } + catch (const std::system_error& SystemError) { if (IsOOM(SystemError.code()) || IsOOD(SystemError.code())) { @@ -2005,11 +2019,11 @@ InitialRequestHandler::HandleCompletion(ULONG IoResult, ULONG_PTR NumberOfBytesT ZEN_ERROR("Caught system error exception while handling request: {}", SystemError.what()); return new HttpMessageResponseRequest(Transaction(), (uint16_t)HttpResponseCode::InternalServerError, SystemError.what()); } - catch (std::bad_alloc& BadAlloc) + catch (const std::bad_alloc& BadAlloc) { return new HttpMessageResponseRequest(Transaction(), (uint16_t)HttpResponseCode::InsufficientStorage, BadAlloc.what()); } - catch (std::exception& ex) + catch (const std::exception& ex) { ZEN_ERROR("Caught exception while handling request: '{}'", ex.what()); return new HttpMessageResponseRequest(Transaction(), (uint16_t)HttpResponseCode::InternalServerError, ex.what()); -- cgit v1.2.3 From ee5fcbce34eaef87ffced2a993c8443af4af4fe2 Mon Sep 17 00:00:00 2001 From: Dan Engelbrecht Date: Fri, 14 Jun 2024 22:12:57 +0200 Subject: don't assert that we have moved bytes if source block is zero size (#97) * don't assert that we have moved bytes if source block is zero size * handle invalid session ids gracefully --- src/zenhttp/servers/httpsys.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/zenhttp/servers/httpsys.cpp') diff --git a/src/zenhttp/servers/httpsys.cpp b/src/zenhttp/servers/httpsys.cpp index 2b97e3f25..ac17d3ba0 100644 --- a/src/zenhttp/servers/httpsys.cpp +++ b/src/zenhttp/servers/httpsys.cpp @@ -1668,7 +1668,7 @@ HttpSysServerRequest::ParseSessionId() const { if (Header.RawValueLength == Oid::StringLength) { - return Oid::FromHexString({Header.pRawValue, Header.RawValueLength}); + return Oid::TryFromHexString({Header.pRawValue, Header.RawValueLength}); } } } -- cgit v1.2.3 From e6f44577f469e891ed8dab1492a4c53224e0b765 Mon Sep 17 00:00:00 2001 From: Stefan Boberg Date: Mon, 2 Dec 2024 12:21:53 +0100 Subject: added support for dynamic LLM tags (#245) * added FLLMTag which can be used to register memory tags outside of core * changed `UE_MEMSCOPE` -> `ZEN_MEMSCOPE` for consistency * instrumented some subsystems with dynamic tags --- src/zenhttp/servers/httpsys.cpp | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'src/zenhttp/servers/httpsys.cpp') diff --git a/src/zenhttp/servers/httpsys.cpp b/src/zenhttp/servers/httpsys.cpp index ac17d3ba0..9e8044a58 100644 --- a/src/zenhttp/servers/httpsys.cpp +++ b/src/zenhttp/servers/httpsys.cpp @@ -9,6 +9,7 @@ #include #include #include +#include #include #include #include @@ -25,6 +26,14 @@ namespace zen { +const FLLMTag& +GetHttpsysTag() +{ + static FLLMTag HttpsysTag("httpsys"); + + return HttpsysTag; +} + /** * @brief Windows implementation of HTTP server based on http.sys * @@ -901,6 +910,8 @@ HttpSysServer::HttpSysServer(const HttpSysConfig& InConfig) , m_IsAsyncResponseEnabled(InConfig.IsAsyncResponseEnabled) , m_InitialConfig(InConfig) { + ZEN_MEMSCOPE(GetHttpsysTag()); + // Initialize thread pool int MinThreadCount; @@ -976,6 +987,8 @@ HttpSysServer::Close() int HttpSysServer::InitializeServer(int BasePort) { + ZEN_MEMSCOPE(GetHttpsysTag()); + using namespace std::literals; WideStringBuilder<64> WildcardUrlPath; @@ -1220,6 +1233,8 @@ HttpSysServer::Cleanup() WorkerThreadPool& HttpSysServer::WorkPool() { + ZEN_MEMSCOPE(GetHttpsysTag()); + if (!m_AsyncWorkPool) { RwLock::ExclusiveLockScope _(m_AsyncWorkPoolInitLock); @@ -1304,6 +1319,8 @@ HttpSysServer::IssueNewRequestMaybe() return; } + ZEN_MEMSCOPE(GetHttpsysTag()); + std::unique_ptr Request = std::make_unique(*this); std::error_code ErrorCode; @@ -1327,6 +1344,8 @@ HttpSysServer::IssueNewRequestMaybe() void HttpSysServer::RegisterService(const char* UrlPath, HttpService& Service) { + ZEN_MEMSCOPE(GetHttpsysTag()); + if (UrlPath[0] == '/') { ++UrlPath; -- cgit v1.2.3 From 376ba6bf28792971275e9f56181f4b5230b05066 Mon Sep 17 00:00:00 2001 From: Stefan Boberg Date: Wed, 11 Dec 2024 12:58:21 +0100 Subject: Memory tracking improvements (#262) * added LLM tag to properly tag RPC allocations * annotated some more httpsys functions with memory tags * only emit memory scope events if the active tag is different from the new tag --- src/zenhttp/servers/httpsys.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'src/zenhttp/servers/httpsys.cpp') diff --git a/src/zenhttp/servers/httpsys.cpp b/src/zenhttp/servers/httpsys.cpp index 9e8044a58..54308a00b 100644 --- a/src/zenhttp/servers/httpsys.cpp +++ b/src/zenhttp/servers/httpsys.cpp @@ -845,6 +845,8 @@ HttpAsyncWorkRequest::HandleCompletion(ULONG IoResult, ULONG_PTR NumberOfBytesTr void HttpAsyncWorkRequest::AsyncWorkItem::Execute() { + ZEN_MEMSCOPE(GetHttpsysTag()); + ZEN_TRACE_CPU("httpsys::async_execute"); try @@ -1726,6 +1728,8 @@ HttpSysServerRequest::ReadPayload() void HttpSysServerRequest::WriteResponse(HttpResponseCode ResponseCode) { + ZEN_MEMSCOPE(GetHttpsysTag()); + ZEN_ASSERT(IsHandled() == false); auto Response = new HttpMessageResponseRequest(m_HttpTx, (uint16_t)ResponseCode); @@ -1743,6 +1747,8 @@ HttpSysServerRequest::WriteResponse(HttpResponseCode ResponseCode) void HttpSysServerRequest::WriteResponse(HttpResponseCode ResponseCode, HttpContentType ContentType, std::span Blobs) { + ZEN_MEMSCOPE(GetHttpsysTag()); + ZEN_ASSERT(IsHandled() == false); auto Response = new HttpMessageResponseRequest(m_HttpTx, (uint16_t)ResponseCode, ContentType, Blobs); @@ -1760,6 +1766,8 @@ HttpSysServerRequest::WriteResponse(HttpResponseCode ResponseCode, HttpContentTy void HttpSysServerRequest::WriteResponse(HttpResponseCode ResponseCode, HttpContentType ContentType, std::u8string_view ResponseString) { + ZEN_MEMSCOPE(GetHttpsysTag()); + ZEN_ASSERT(IsHandled() == false); auto Response = @@ -1778,6 +1786,8 @@ HttpSysServerRequest::WriteResponse(HttpResponseCode ResponseCode, HttpContentTy void HttpSysServerRequest::WriteResponseAsync(std::function&& ContinuationHandler) { + ZEN_MEMSCOPE(GetHttpsysTag()); + if (m_HttpTx.Server().IsAsyncResponseEnabled()) { m_NextCompletionHandler = new HttpAsyncWorkRequest(m_HttpTx, std::move(ContinuationHandler)); @@ -1875,6 +1885,8 @@ InitialRequestHandler::IssueRequest(std::error_code& ErrorCode) HttpSysRequestHandler* InitialRequestHandler::HandleCompletion(ULONG IoResult, ULONG_PTR NumberOfBytesTransferred) { + ZEN_MEMSCOPE(GetHttpsysTag()); + auto _ = MakeGuard([&] { m_IsInitialRequest = false; }); switch (IoResult) @@ -2085,6 +2097,8 @@ HttpSysServer::RegisterService(HttpService& Service) Ref CreateHttpSysServer(HttpSysConfig Config) { + ZEN_MEMSCOPE(GetHttpsysTag()); + return Ref(new HttpSysServer(Config)); } -- cgit v1.2.3 From d7dbc855ab2bd2ccf86f809b463bda3ba38d64ce Mon Sep 17 00:00:00 2001 From: Dan Engelbrecht Date: Mon, 13 Jan 2025 12:51:12 +0100 Subject: Suppress progress report callback if oplog import detects zero op oplog (#271) * Suppress progress report callback if oplog import detects oplog with zero ops * output error code when catching system errors --- src/zenhttp/servers/httpsys.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/zenhttp/servers/httpsys.cpp') diff --git a/src/zenhttp/servers/httpsys.cpp b/src/zenhttp/servers/httpsys.cpp index 54308a00b..bf7b8b7d7 100644 --- a/src/zenhttp/servers/httpsys.cpp +++ b/src/zenhttp/servers/httpsys.cpp @@ -2047,7 +2047,7 @@ InitialRequestHandler::HandleCompletion(ULONG IoResult, ULONG_PTR NumberOfBytesT return new HttpMessageResponseRequest(Transaction(), (uint16_t)HttpResponseCode::InsufficientStorage, SystemError.what()); } - ZEN_ERROR("Caught system error exception while handling request: {}", SystemError.what()); + ZEN_ERROR("Caught system error exception while handling request: {}. ({})", SystemError.what(), SystemError.code().value()); return new HttpMessageResponseRequest(Transaction(), (uint16_t)HttpResponseCode::InternalServerError, SystemError.what()); } catch (const std::bad_alloc& BadAlloc) -- cgit v1.2.3 From a5158f9fc806d506590dd9bf0e3282cb76c3ac4e Mon Sep 17 00:00:00 2001 From: Dan Engelbrecht Date: Thu, 16 Jan 2025 09:19:08 +0100 Subject: move basicfile.h/cpp -> zencore (#273) move jupiter.h/cpp -> zenutil move packageformat.h/.cpp -> zenhttp zenutil now depends on zenhttp instead of the inverse --- src/zenhttp/servers/httpsys.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/zenhttp/servers/httpsys.cpp') diff --git a/src/zenhttp/servers/httpsys.cpp b/src/zenhttp/servers/httpsys.cpp index bf7b8b7d7..87128c0c9 100644 --- a/src/zenhttp/servers/httpsys.cpp +++ b/src/zenhttp/servers/httpsys.cpp @@ -14,7 +14,7 @@ #include #include #include -#include +#include #if ZEN_WITH_HTTPSYS # define _WINSOCKAPI_ -- cgit v1.2.3 From 920120bbcec9f91df3336f62970b3e010a4fa6c2 Mon Sep 17 00:00:00 2001 From: Stefan Boberg Date: Thu, 6 Mar 2025 16:18:32 +0100 Subject: reduced memory churn using fixed_xxx containers (#236) * Added EASTL to help with eliminating memory allocations * Applied EASTL to eliminate memory allocations, primarily by using `fixed_vector` et al to use stack allocations / inline struct allocations Reduces memory events in traces by close to a factor of 10 in test scenario (starting editor for project F) --- src/zenhttp/servers/httpsys.cpp | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) (limited to 'src/zenhttp/servers/httpsys.cpp') diff --git a/src/zenhttp/servers/httpsys.cpp b/src/zenhttp/servers/httpsys.cpp index 87128c0c9..3bdcdf098 100644 --- a/src/zenhttp/servers/httpsys.cpp +++ b/src/zenhttp/servers/httpsys.cpp @@ -16,6 +16,8 @@ #include #include +#include + #if ZEN_WITH_HTTPSYS # define _WINSOCKAPI_ # include @@ -381,14 +383,14 @@ public: void SuppressResponseBody(); // typically used for HEAD requests private: - std::vector m_HttpDataChunks; - uint64_t m_TotalDataSize = 0; // Sum of all chunk sizes - uint16_t m_ResponseCode = 0; - uint32_t m_NextDataChunkOffset = 0; // Cursor used for very large chunk lists - uint32_t m_RemainingChunkCount = 0; // Backlog for multi-call sends - bool m_IsInitialResponse = true; - HttpContentType m_ContentType = HttpContentType::kBinary; - std::vector m_DataBuffers; + eastl::fixed_vector m_HttpDataChunks; + uint64_t m_TotalDataSize = 0; // Sum of all chunk sizes + uint16_t m_ResponseCode = 0; + uint32_t m_NextDataChunkOffset = 0; // Cursor used for very large chunk lists + uint32_t m_RemainingChunkCount = 0; // Backlog for multi-call sends + bool m_IsInitialResponse = true; + HttpContentType m_ContentType = HttpContentType::kBinary; + eastl::fixed_vector m_DataBuffers; void InitializeForPayload(uint16_t ResponseCode, std::span Blobs); }; -- cgit v1.2.3 From 764dba27c3183122989a401824c1771249f335da Mon Sep 17 00:00:00 2001 From: Dan Engelbrecht Date: Wed, 19 Mar 2025 16:12:06 +0100 Subject: build list filters (#313) - Feature: `zen builds list` command has new options - `--query-path` - path to a .json (json format) or .cbo (compact binary object format) with the search query to use - `--result-path` - path to a .json (json format) or .cbo (compact binary object format) to write output result to, if omitted json format will be output to console --- src/zenhttp/servers/httpsys.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/zenhttp/servers/httpsys.cpp') diff --git a/src/zenhttp/servers/httpsys.cpp b/src/zenhttp/servers/httpsys.cpp index 3bdcdf098..a315ea2df 100644 --- a/src/zenhttp/servers/httpsys.cpp +++ b/src/zenhttp/servers/httpsys.cpp @@ -684,7 +684,7 @@ HttpMessageResponseRequest::IssueRequest(std::error_code& ErrorCode) ); } - auto EmitReponseDetails = [&](StringBuilderBase& ResponseDetails) -> void { + auto EmitResponseDetails = [&](StringBuilderBase& ResponseDetails) -> void { for (int i = 0; i < ThisRequestChunkCount; ++i) { const HTTP_DATA_CHUNK Chunk = m_HttpDataChunks[ThisRequestChunkOffset + i]; @@ -767,7 +767,7 @@ HttpMessageResponseRequest::IssueRequest(std::error_code& ErrorCode) // Emit diagnostics ExtendableStringBuilder<256> ResponseDetails; - EmitReponseDetails(ResponseDetails); + EmitResponseDetails(ResponseDetails); ZEN_WARN("failed to send HTTP response (error {}: '{}'), request URL: '{}', ({}.{}) response: {}", SendResult, -- cgit v1.2.3 From a4676ccaf5a98b0d4204f70f43e88640db6ce29d Mon Sep 17 00:00:00 2001 From: Dan Engelbrecht Date: Tue, 13 May 2025 19:09:21 +0200 Subject: extend log on failed httpsys response (#394) * extend log on failed httpsys response * fix formatting for "Desired port is in use, retrying" * add warning log if port is remapped --- src/zenhttp/servers/httpsys.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'src/zenhttp/servers/httpsys.cpp') diff --git a/src/zenhttp/servers/httpsys.cpp b/src/zenhttp/servers/httpsys.cpp index a315ea2df..62dab02c4 100644 --- a/src/zenhttp/servers/httpsys.cpp +++ b/src/zenhttp/servers/httpsys.cpp @@ -535,7 +535,14 @@ HttpMessageResponseRequest::HandleCompletion(ULONG IoResult, ULONG_PTR NumberOfB if (IoResult != NO_ERROR) { - ZEN_WARN("response aborted due to error: {}", GetSystemErrorAsString(IoResult)); + ZEN_WARN("response '{}' ({}) aborted after transfering '{}', {} out of {} bytes, reason: {} ({})", + ReasonStringForHttpResultCode(m_ResponseCode), + m_ResponseCode, + ToString(m_ContentType), + NumberOfBytesTransferred, + m_TotalDataSize, + GetSystemErrorAsString(IoResult), + IoResult); // if one transmit failed there's really no need to go on return nullptr; -- cgit v1.2.3 From fb6426127354415505dbedacd63b3a16116dac2f Mon Sep 17 00:00:00 2001 From: Dan Engelbrecht Date: Fri, 22 Aug 2025 18:16:09 +0200 Subject: clean up trace options parsing (#473) * clean up trace command line options explicitly shut down worker pools * some additional startup trace scopes --- src/zenhttp/servers/httpsys.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/zenhttp/servers/httpsys.cpp') diff --git a/src/zenhttp/servers/httpsys.cpp b/src/zenhttp/servers/httpsys.cpp index 62dab02c4..e57fa8a30 100644 --- a/src/zenhttp/servers/httpsys.cpp +++ b/src/zenhttp/servers/httpsys.cpp @@ -2078,6 +2078,8 @@ InitialRequestHandler::HandleCompletion(ULONG IoResult, ULONG_PTR NumberOfBytesT int HttpSysServer::Initialize(int BasePort, std::filesystem::path DataDir) { + ZEN_TRACE_CPU("HttpSysServer::Initialize"); + ZEN_UNUSED(DataDir); if (int EffectivePort = InitializeServer(BasePort)) { @@ -2106,6 +2108,7 @@ HttpSysServer::RegisterService(HttpService& Service) Ref CreateHttpSysServer(HttpSysConfig Config) { + ZEN_TRACE_CPU("CreateHttpSysServer"); ZEN_MEMSCOPE(GetHttpsysTag()); return Ref(new HttpSysServer(Config)); -- cgit v1.2.3 From 339668ac935f781c06225d2d685642e27348772b Mon Sep 17 00:00:00 2001 From: Dan Engelbrecht Date: Wed, 10 Sep 2025 16:38:33 +0200 Subject: add EMode to WorkerTheadPool to avoid thread starvation (#492) - Improvement: Add a new mode to worker thread pools to avoid starvation of workers which could cause long stalls due to other work begin queued up. UE-305498 --- src/zenhttp/servers/httpsys.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/zenhttp/servers/httpsys.cpp') diff --git a/src/zenhttp/servers/httpsys.cpp b/src/zenhttp/servers/httpsys.cpp index e57fa8a30..9bbfef255 100644 --- a/src/zenhttp/servers/httpsys.cpp +++ b/src/zenhttp/servers/httpsys.cpp @@ -835,7 +835,7 @@ HttpAsyncWorkRequest::IssueRequest(std::error_code& ErrorCode) ZEN_TRACE_CPU("httpsys::AsyncWork::IssueRequest"); ErrorCode.clear(); - Transaction().Server().WorkPool().ScheduleWork(m_WorkItem); + Transaction().Server().WorkPool().ScheduleWork(m_WorkItem, WorkerThreadPool::EMode::EnableBacklog); } HttpSysRequestHandler* -- cgit v1.2.3 From b8c0b72232642183156e59ff8d2535cc3353ff0e Mon Sep 17 00:00:00 2001 From: Dan Engelbrecht Date: Mon, 15 Sep 2025 10:58:25 +0200 Subject: revise exception vs error (#495) - Change BadAlloc exceptions in GC to warnings - Add explict ASSERT exception catch in http plugin request processing - Make exceptions handled in http request processing to warnings --- src/zenhttp/servers/httpsys.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/zenhttp/servers/httpsys.cpp') diff --git a/src/zenhttp/servers/httpsys.cpp b/src/zenhttp/servers/httpsys.cpp index 9bbfef255..95d83911d 100644 --- a/src/zenhttp/servers/httpsys.cpp +++ b/src/zenhttp/servers/httpsys.cpp @@ -2056,7 +2056,7 @@ InitialRequestHandler::HandleCompletion(ULONG IoResult, ULONG_PTR NumberOfBytesT return new HttpMessageResponseRequest(Transaction(), (uint16_t)HttpResponseCode::InsufficientStorage, SystemError.what()); } - ZEN_ERROR("Caught system error exception while handling request: {}. ({})", SystemError.what(), SystemError.code().value()); + ZEN_WARN("Caught system error exception while handling request: {}. ({})", SystemError.what(), SystemError.code().value()); return new HttpMessageResponseRequest(Transaction(), (uint16_t)HttpResponseCode::InternalServerError, SystemError.what()); } catch (const std::bad_alloc& BadAlloc) @@ -2065,7 +2065,7 @@ InitialRequestHandler::HandleCompletion(ULONG IoResult, ULONG_PTR NumberOfBytesT } catch (const std::exception& ex) { - ZEN_ERROR("Caught exception while handling request: '{}'", ex.what()); + ZEN_WARN("Caught exception while handling request: '{}'", ex.what()); return new HttpMessageResponseRequest(Transaction(), (uint16_t)HttpResponseCode::InternalServerError, ex.what()); } } -- cgit v1.2.3