Skip to content

chore: log the HTTP client steps at FINE and keep the FINE logs of CI test runs - #1602

Merged
jlouvel merged 3 commits into
3.0from
chore/security-test-client-logging
Nov 2, 2026
Merged

jlouvel merged 3 commits into
3.0from
chore/security-test-client-logging

Conversation

@jlouvel

@jlouvel jlouvel commented Oct 30, 2026

Copy link
Copy Markdown
Collaborator

Refs #1601.

SecurityTestCase sometimes gets Communication Error (1001) instead of a 401/403 in CI. The client logs only the final IOException, and only at FINE, which CI doesn't enable, so we can't see which step fails. This PR doesn't fix the failure. It makes the next one diagnosable.

Changes

  • NettyClientHelper logs at FINE each connection:

    • opened
    • reused from the pool
    • discarded because inactive
    • returned to the pool or closed (with the reusable flag)
    • closed (from its close future)
  • NettyClientCall logs at FINE:

    • each request sent
    • each response head received (with the status)
    • each response end received
    • each exchange failure, with its cause

    Every message includes the Netty channel, which shows the id and the local and remote ports. The messages are suppliers, so they cost nothing when FINE is off.

  • org.restlet/pom.xml: new ci-logging profile. It points the default-test execution to src/test/ci-logging.properties. That config keeps the console at INFO, and writes the FINE logs of the org.restlet loggers to org.restlet/target/restlet-fine.log.

  • build.yaml: the build uses -P default,test,ci-logging. When the build fails, a new step uploads the log and the surefire reports as the test-logs artifact.

  • changes.md: entry under Misc.

Notes

  • Local full run of org.restlet with the profile: the log is 1.8 MB, about 15k lines.
  • ShutdownHookTestCase.whenServerIsHandlingBlockingRequestThenItRefusesNewRequest failed locally on Windows, with and without the profile. Its ±200 ms timing tolerance is too tight on this machine, so the failure is unrelated to this change. All 2214 other tests passed.
  • Setting java.util.logging.config.file turns Engine.configureLog() into a no-op for those test runs. No test depends on it: ConnectorTestCase only sets the INFO level, which the config already uses.

How to read a failure

Download the test-logs artifact, then search restlet-fine.log for the port in the failing test's URI (R:localhost/127.0.0.1:<port>). The sequence shows whether the request went on a reused connection, whether the response head arrived, and when the connection closed relative to the failure.

🤖 Generated with Claude Code

@jlouvel
jlouvel requested a balanced review from Copilot October 30, 2026 14:52
@jlouvel jlouvel self-assigned this Oct 30, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The new log runs before the completed-exchange guard, causing normal HTTP/2 and HTTP/3 stream teardown to emit misleading failure messages and stack traces after successful exchanges.

1 open issue
What changed in this PR

This PR adds diagnostics for intermittent HTTP client failures tracked in #1601. It expands Netty logging and preserves CI test logs for investigation; it does not fix the underlying failure.

Changes:

  • Adds FINE logs for connection lifecycle events and request/response exchanges.
  • Introduces a CI logging profile that writes detailed Restlet logs while keeping console output at INFO.
  • Uploads logs and test reports after CI failures and documents the change.
File Description
org.restlet/​src/​test/​ci-logging.properties Configures INFO console output and FINE file logging.
org.restlet/​src/​main/​java/​org/​restlet/​engine/​netty/​NettyClientHelper.java Logs connection creation, reuse, pooling, and closure.
org.restlet/​src/​main/​java/​org/​restlet/​engine/​netty/​NettyClientCall.java Logs request sending, response receipt, and exchange failures.
org.restlet/​pom.xml Adds the ci-logging test profile.
changes.md Records the new diagnostics and CI log retention.
.github/​workflows/​build.yaml Enables CI logging and uploads diagnostic artifacts on failure.

Review effort: Balanced

jlouvel and others added 3 commits November 1, 2026 11:18
To diagnose the intermittent Communication Error (1001) of SecurityTestCase,
the Netty client logs at FINE each connection opened, reused, discarded or
closed, each request sent, each response head and end received, and each
exchange failure. The new "ci-logging" profile writes the FINE logs of the core
tests to target/restlet-fine.log, which CI uploads when the build fails.

Refs #1601

Co-Authored-By: Claude Opus 5.5 <[email protected]>
… logs

The client call now logs the end of the response through its helper.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@jlouvel
jlouvel force-pushed the chore/security-test-client-logging branch from 0e1ab36 to 0f66c6d Compare November 1, 2026 17:16
@sonarqubecloud

sonarqubecloud Bot commented Nov 1, 2026

Copy link
Copy Markdown

@jlouvel
jlouvel merged commit 6396451 into 3.0 Nov 2, 2026
3 checks passed
@jlouvel
jlouvel deleted the chore/security-test-client-logging branch November 2, 2026 00:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants