🐛 Graceful shutdowns shouldn't produce error logs
Describe the bug
When i send a SIGTERM to my cloudflared tunnel run i get like 8-9 error logs.
To Reproduce Steps to reproduce the behavior:
- Run
cloudflared tunnel run $tunnel_id - Let is start fully
- Call
kill -15 $pid
Expected behavior I would expect a graceful shutdown didn't print error logs
Logs and errors
2023-08-04T09:42:19Z INF Initiating graceful shutdown due to signal terminated ...
2023-08-04T09:42:19Z ERR writing finish: Application error 0x0 (remote)
2023-08-04T09:42:19Z INF Unregistered tunnel connection connIndex=3 event=0 ip=198.41.200.43
2023-08-04T09:42:19Z ERR Failed to serve quic connection error="Application error 0x0 (remote)" connIndex=3 event=0 ip=198.41.200.43
2023-08-04T09:42:19Z ERR Serve tunnel error error="Application error 0x0 (remote)" connIndex=3 event=0 ip=198.41.200.43
2023-08-04T09:42:19Z INF Retrying connection in up to 1s connIndex=3 event=0 ip=198.41.200.43
2023-08-04T09:42:19Z INF Unregistered tunnel connection connIndex=0 event=0 ip=198.41.192.67
2023-08-04T09:42:19Z ERR Failed to serve quic connection error="context canceled" connIndex=0 event=0 ip=198.41.192.67
2023-08-04T09:42:19Z INF Retrying connection in up to 1s connIndex=0 event=0 ip=198.41.192.67
2023-08-04T09:42:19Z INF Unregistered tunnel connection connIndex=1 event=0 ip=198.41.200.33
2023-08-04T09:42:19Z ERR Failed to serve quic connection error="context canceled" connIndex=1 event=0 ip=198.41.200.33
2023-08-04T09:42:19Z INF Retrying connection in up to 1s connIndex=1 event=0 ip=198.41.200.33
2023-08-04T09:42:20Z INF Unregistered tunnel connection connIndex=2 event=0 ip=198.41.192.167
2023-08-04T09:42:20Z ERR Failed to serve quic connection error="Application error 0x0 (remote)" connIndex=2 event=0 ip=198.41.192.167
2023-08-04T09:42:20Z ERR Serve tunnel error error="Application error 0x0 (remote)" connIndex=2 event=0 ip=198.41.192.167
2023-08-04T09:42:20Z INF Retrying connection in up to 1s connIndex=2 event=0 ip=198.41.192.167
2023-08-04T09:42:20Z ERR no more connections active and exiting
2023-08-04T09:42:20Z INF Tunnel server stopped
2023-08-04T09:42:20Z ERR icmp router terminated error="context canceled"
2023-08-04T09:42:20Z INF Metrics server stopped
That's true. Thanks for the report.
Would you like to open a PR to address this?
That's true. Thanks for the report.
Would you like to open a PR to address this?
I think this is beyond my golang "skills".
I'll give it a go, but don't get your hopes up 🤣
Does this still need to be fixed? I can give it a go
It's present in 2023.8.2, which is the latest version. @Lumexralph
Here is how we deploy the tunnel in docker swarm
services:
cloudflared:
image: cloudflare/cloudflared:2023.8.2
command: tunnel run ${TUNNEL_UUID}
configs:
- source: cloudflared-cred-file
target: /etc/cloudflared/${TUNNEL_UUID}.json
environment:
TUNNEL_URL: http://webserver:80
deploy:
update_config: { order: start-first, parallelism: 0 }
I don't know if anyone from Cloudflare can give more insights on this before jumping into the wild