Skip to content

feat(plc4go): name every timeout via utils.WithNamedTimeout - #2688

Merged
sruehl merged 1 commit into
developfrom
feat/timeout_naming
Aug 12, 2026
Merged

feat(plc4go): name every timeout via utils.WithNamedTimeout#2688
sruehl merged 1 commit into
developfrom
feat/timeout_naming

Conversation

@sruehl

@sruehl sruehl commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

context.DeadlineExceeded is a metadata-free singleton: a bare "context deadline exceeded" never says which of the stacked deadlines fired or what its value was, making field timeouts undiagnosable.

utils.WithNamedTimeout wraps context.WithTimeoutCause with a cause that reads " exceeded" AND wraps the sentinel, so context.Cause carries the diagnosis while errors.Is(err, context.DeadlineExceeded) keeps working for every consumer (net/http propagates the cause in place of the sentinel since Go 1.23).

All 16 bare context.WithTimeout call sites are converted with descriptive names (transaction completion timeout, segment ack wait timeout, MMI read timeout, connection close timeout, ...).

context.DeadlineExceeded is a metadata-free singleton: a bare
"context deadline exceeded" never says which of the stacked deadlines
fired or what its value was, making field timeouts undiagnosable.

utils.WithNamedTimeout wraps context.WithTimeoutCause with a cause that
reads "<name> <duration> exceeded" AND wraps the sentinel, so
context.Cause carries the diagnosis while errors.Is(err,
context.DeadlineExceeded) keeps working for every consumer (net/http
propagates the cause in place of the sentinel since Go 1.23).

All 16 bare context.WithTimeout call sites are converted with
descriptive names (transaction completion timeout, segment ack wait
timeout, MMI read timeout, connection close timeout, ...).
@sruehl
sruehl requested a review from chrisdutz August 12, 2026 07:46
@sruehl
sruehl merged commit 0187552 into develop Aug 12, 2026
3 of 4 checks passed
@sruehl
sruehl deleted the feat/timeout_naming branch August 12, 2026 11:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants