aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Engelbrecht <[email protected]>2025-05-13 19:09:21 +0200
committerGitHub Enterprise <[email protected]>2025-05-13 19:09:21 +0200
commita4676ccaf5a98b0d4204f70f43e88640db6ce29d (patch)
treeab6fdff59118f2a7c030c49ddf8a0a4ce195be04
parentskip empty or single-space command line arguments (#393) (diff)
downloadzen-a4676ccaf5a98b0d4204f70f43e88640db6ce29d.tar.xz
zen-a4676ccaf5a98b0d4204f70f43e88640db6ce29d.zip
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
-rw-r--r--CHANGELOG.md3
-rw-r--r--src/zenhttp/servers/httpasio.cpp21
-rw-r--r--src/zenhttp/servers/httpsys.cpp9
3 files changed, 24 insertions, 9 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 91e3302bc..5e7b0d68b 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -27,6 +27,8 @@
- Improvement: Remove CAS log files at startup when we write full state index
- Improvement: Optimize memory-buffered chunk iteration sizes
- Improvement: Skip command line arguments that are empty or just a single space for `zen` command line tool on Mac/Linux to handle "triple space" problem. UE-273411
+- Improvement: Extend log information when httpsys response sending fails
+- Improvement: Log warning when port remappng occurs due to desired port is already in use
## 5.6.7
- Feature: Support for `--log-progress` to output UE style `@progress` log messages has been added to
@@ -38,7 +40,6 @@
- Feature: `zen builds upload` and `zen builds download` not accepts `--allow-redirect` for Cloud hosts allowing direct upload to/download from backend store (such as S3)
- Bugfix: Add explicit lambda capture in CasContainer::IterateChunks to avoid accessing state data references
- Bugfix: Validate compact binary objects stored in cache before attempting to parse them to avoid crash when data is corrupt
-- Bugfix: Don't report redundant error if disk is full when writing GC state or GC log
- Bugfix: Add explicit lambda capture in CasContainer::IterateChunks to avoid accessing state data references
- Bugfix: Validate compact binary objects stored in cache before attempting to parse them to avoid crash when data is corrupt
- Bugfix: Don't report redundant error if disk is full when writing GC state or GC log
diff --git a/src/zenhttp/servers/httpasio.cpp b/src/zenhttp/servers/httpasio.cpp
index fe59e3a6f..c1b7294c9 100644
--- a/src/zenhttp/servers/httpasio.cpp
+++ b/src/zenhttp/servers/httpasio.cpp
@@ -678,7 +678,7 @@ struct HttpAcceptor
if (BindErrorCode == asio::error::address_in_use)
{
// Do a retry after a short sleep on same port just to be sure
- ZEN_INFO("Desired port %d is in use, retrying", BasePort);
+ ZEN_INFO("Desired port {} is in use, retrying", BasePort);
Sleep(100);
m_Acceptor.bind(asio::ip::tcp::endpoint(BindAddress, EffectivePort), BindErrorCode);
}
@@ -697,13 +697,20 @@ struct HttpAcceptor
{
ZEN_ERROR("Unable open asio service, error '{}'", BindErrorCode.message());
}
- else if (BindAddress.is_loopback())
+ else
{
- m_AlternateProtocolAcceptor.bind(asio::ip::tcp::endpoint(asio::ip::address_v4::loopback(), EffectivePort), BindErrorCode);
- m_UseAlternateProtocolAcceptor = true;
- ZEN_INFO("Registered local-only handler 'http://{}:{}/' - this is not accessible from remote hosts",
- "localhost",
- EffectivePort);
+ if (EffectivePort != BasePort)
+ {
+ ZEN_WARN("Desired port {} is in use, remapped to port {}", BasePort, EffectivePort);
+ }
+ if (BindAddress.is_loopback())
+ {
+ m_AlternateProtocolAcceptor.bind(asio::ip::tcp::endpoint(asio::ip::address_v4::loopback(), EffectivePort), BindErrorCode);
+ m_UseAlternateProtocolAcceptor = true;
+ ZEN_INFO("Registered local-only handler 'http://{}:{}/' - this is not accessible from remote hosts",
+ "localhost",
+ EffectivePort);
+ }
}
#if ZEN_PLATFORM_WINDOWS
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;