Skip to content

Commit

Permalink
better log messages for tunnel teardown
Browse files Browse the repository at this point in the history
  • Loading branch information
RalfJung committed Mar 16, 2020
1 parent 9801997 commit 6a96b53
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion broker/src/tunneldigger_broker/tunnel.py
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,7 @@ def keepalive(self):

# Check if the tunnel is still alive.
if time.time() - self.last_alive > 120:
logger.warning("Tunnel %d (%s) timed out", self.tunnel_id, self.uuid)
self.close(reason=protocol.ERROR_REASON_FROM_SERVER | protocol.ERROR_REASON_TIMEOUT)

def close(self, reason=protocol.ERROR_REASON_UNDEFINED):
Expand All @@ -240,7 +241,7 @@ def close(self, reason=protocol.ERROR_REASON_UNDEFINED):
:param reason: Reason code for the tunnel being closed
"""

logger.info("Closing tunnel %d after %d seconds", self.tunnel_id, time.time() - self.created_time)
logger.info("Closing tunnel %d (%s) after %d seconds", self.tunnel_id, self.uuid, time.time() - self.created_time)

# Run pre-down hook.
self.broker.hook_manager.run_hook(
Expand Down

0 comments on commit 6a96b53

Please sign in to comment.