seniorGolang

Explain Context Cancellation propagation in distributed systems.

Updated Apr 28, 2026

Short answer

Context cancellation allows aborting a chain of distributed requests to save resources if the client disconnects or times out.

Deep explanation

When an HTTP server receives a request, it generates a Context. If that server makes a gRPC call to another service, it passes the Context. If the user closes their browser, the initial context cancels. The HTTP server aborts its work, and the gRPC client intercepts the cancellation and forwards a cancellation frame over HTTP/2, halting the downstream service.

Unlock with a Pro subscription to view this section.

View pricing

Real-world example

No real-world example available yet.

Unlock with a Pro subscription to view this section.

Upgrade to Pro

Common mistakes

No common mistakes listed yet.

Unlock with a Pro subscription to view this section.

Upgrade to Pro

Follow-up questions

No follow-up questions available yet.

Unlock with a Pro subscription to view this section.

Upgrade to Pro

More Golang interview questions

View all →