Skip to content

Conversation

@bryancall
Copy link
Contributor

@bryancall bryancall commented Jan 6, 2026

Add new SquidLogCode to identify when CONNECT tunnels time out due to active timeout. This makes tunnel timeouts visible in access logs via the crc (cache result code) field.

Problem:
Previously, tunnel timeouts were not distinguishable in logs - users could only see them in DEBUG logs.

Solution:

  • Add ERR_TUN_ACTIVE_TIMEOUT = 'T' to SquidLogCode enum
  • Set the squid code in tunnel_handler_ssl_producer() and tunnel_handler_ssl_consumer() on VC_EVENT_ACTIVE_TIMEOUT
  • Add string mapping in Log.cc

Result:
Access logs now show crc=ERR_TUN_ACTIVE_TIMEOUT for timed-out CONNECT tunnels.

Testing:
Includes autotest tunnel_active_timeout.test.py that verifies the squid code is logged correctly.

Add new SquidLogCode to identify when CONNECT tunnels time out due to
active timeout. This makes tunnel timeouts visible in access logs via
the crc (cache result code) field.

Previously, tunnel timeouts were not distinguishable in logs - users
could only see them in DEBUG logs. Now the access log will show
crc=ERR_TUN_ACTIVE_TIMEOUT for timed-out tunnels.

Includes autotest to verify the squid code is logged correctly.
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR adds a new squid log code ERR_TUN_ACTIVE_TIMEOUT to identify when CONNECT tunnels time out due to active timeout, making these events visible in access logs via the crc (cache result code) field.

Key Changes:

  • Add ERR_TUN_ACTIVE_TIMEOUT = 'T' enum value for tunnel active timeouts
  • Set the squid code in SSL tunnel handlers when VC_EVENT_ACTIVE_TIMEOUT occurs
  • Include comprehensive test coverage to verify the logging behavior

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
include/proxy/hdrs/HTTP.h Adds new ERR_TUN_ACTIVE_TIMEOUT enum value to SquidLogCode
src/proxy/http/HttpSM.cc Sets the squid code in SSL tunnel producer and consumer handlers on active timeout events
src/proxy/logging/Log.cc Updates the log field alias table to include the new squid code string mapping
tests/gold_tests/timeout/tunnel_timeout_client.py Provides test client that establishes CONNECT tunnel and holds it idle to trigger timeout
tests/gold_tests/timeout/tunnel_active_timeout.test.py Test case that verifies ERR_TUN_ACTIVE_TIMEOUT is logged for tunnel timeouts

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 24 to 26
import time


Copy link

Copilot AI Jan 6, 2026

Choose a reason for hiding this comment

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

Import of 'time' is not used.

Suggested change
import time

Copilot uses AI. Check for mistakes.
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 5 out of 5 changed files in this pull request and generated no new comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

- Add proxy.config.log.max_secs_per_buffer=1 to force log flush
- Add delay test run to wait for log file to be written
- Remove unused 'import time' from client script
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant