79605644

Date: 2025-05-04 13:05:03
Score: 0.5
Natty:
Report link

From chatGPT

If your Go app takes about a minute to shut down after Ctrl+C, here's what's likely happening:

🔍 Root Cause You pressed Ctrl+C:

Docker Compose sends SIGINT to your container.

Your Go app received the signal, and the <-stop channel unblocked.

Something in your shutdown process is blocking, taking ~1 minute to complete, possibly due to:

A long-running background task or goroutine

An HTTP server that isn’t shutting down immediately

A resource (DB connection, file, etc.) waiting for a timeout

You didn't call os.Exit() or return from main() after cleanup

Reasons:
  • Long answer (-0.5):
  • No code block (0.5):
  • Low reputation (0.5):
Posted by: 许家宝