common: increase robustness of access log file #7978
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Motivaition:
The information about HTTP-based requests (WebDAV and REST) are only logged in the access log file when the request has been processed.
Currently, this logging only happens if the request is handled normally; i.e., no exception was thrown and (for async requests) the processing didn't take too long.
This means that a request that triggers certain failure modes would not have an entry in the access log file.
Modification:
Update existing
requestCompletedmethod to accept aNetLoggerBuilderconsumer. This consumer should add any mode-specific additional logging information.Create methods that handle the three modes in which the processing of a request might finish:
requestCompletedNormally,requestCompletedExceptionally,requestTimedOut. All three modes add mode-specific information to the access log entry.The access log entry key-value pairs derived from the response are moved to the
requestCompletedNormallymethod. The other modes will use default responses, rendering this information unreliable in those cases.The async listener
LogOnCompleteis updated so thatonTimeoutandonErrorevent notification triggerrequestTimedOutandrequestCompletedExceptionallylogging, respectively.The
NetLoggerBuilderclass is updated to accept key-value pairs where the value has type Duration.Result:
Fix bug where webdav and frontend door access log files would fail to log requests that trigger certain failures in dCache.
Target: master
Requires-notes: yes
Requires-book: no
Request: 11.1
Request: 11.0
Request: 10.2
Request: 10.1
Request: 10.0
Request: 9.2
Closes: #7939
Patch: https://rb.dcache.org/r/14581/
Acked-by: Tigran Mkrtchyan