Skip to content

fix: client prompt return on context cancellation #1729

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
May 16, 2025

Conversation

umegbewe
Copy link
Contributor

@umegbewe umegbewe commented Feb 3, 2025

This fixes the issue where the client blocks for the entire duration of the response stream, even when the provided context had already been canceled or times out

Relevant issue #1698

Copy link
Member

@bwplotka bwplotka left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! Some questions, not sure if this will work. My understanding was that we have to manually chunk reads from the resp.Body.

@kakkoyun kakkoyun requested a review from bwplotka April 10, 2025 08:27
@kakkoyun
Copy link
Member

@umegbewe The PR need to rebase.
I have also pinged @bwplotka to have another look at it.

Signed-off-by: Umegbewe Nwebedu <nwebedujunior55@gmail.com>
Signed-off-by: Umegbewe Nwebedu <nwebedujunior55@gmail.com>
@umegbewe umegbewe force-pushed the fix/client-context-canceled branch from 9e16398 to 9a59353 Compare April 29, 2025 12:59
Signed-off-by: Umegbewe Nwebedu <nwebedujunior55@gmail.com>
Signed-off-by: Umegbewe Nwebedu <nwebedujunior55@gmail.com>
@umegbewe
Copy link
Contributor Author

@bwplotka @kakkoyun updated, PR is good to go

Copy link
Member

@kakkoyun kakkoyun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@kakkoyun kakkoyun merged commit 7ed72b7 into prometheus:main May 16, 2025
9 checks passed
juliusmh pushed a commit to juliusmh/client_golang that referenced this pull request Jun 30, 2025
* fix: client prompt return on context cancellation

Signed-off-by: Umegbewe Nwebedu <nwebedujunior55@gmail.com>

* test: add context cancellation unit test

Signed-off-by: Umegbewe Nwebedu <nwebedujunior55@gmail.com>

* fix/rid unused package

Signed-off-by: Umegbewe Nwebedu <nwebedujunior55@gmail.com>

* fix/lint and formatting

Signed-off-by: Umegbewe Nwebedu <nwebedujunior55@gmail.com>

---------

Signed-off-by: Umegbewe Nwebedu <nwebedujunior55@gmail.com>
github-merge-queue bot pushed a commit to jaegertracing/jaeger that referenced this pull request Aug 1, 2025
This PR contains the following updates:

| Package | Change | Age | Confidence |
|---|---|---|---|
|
[github.com/prometheus/client_golang](https://redirect.github.com/prometheus/client_golang)
| `v1.22.0` -> `v1.23.0` |
[![age](https://developer.mend.io/api/mc/badges/age/go/github.com%2fprometheus%2fclient_golang/v1.23.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://developer.mend.io/api/mc/badges/confidence/go/github.com%2fprometheus%2fclient_golang/v1.22.0/v1.23.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|

---

### Release Notes

<details>
<summary>prometheus/client_golang
(github.com/prometheus/client_golang)</summary>

###
[`v1.23.0`](https://redirect.github.com/prometheus/client_golang/releases/tag/v1.23.0):
- 2025-07-30

[Compare
Source](https://redirect.github.com/prometheus/client_golang/compare/v1.22.0...v1.23.0)

- \[CHANGE] Minimum required Go version is now 1.23, only the two latest
Go versions are supported from now on.
[#&#8203;1812](https://redirect.github.com/prometheus/client_golang/issues/1812)
- \[FEATURE] Add WrapCollectorWith and WrapCollectorWithPrefix
[#&#8203;1766](https://redirect.github.com/prometheus/client_golang/issues/1766)
- \[FEATURE] Add exemplars for native histograms
[#&#8203;1686](https://redirect.github.com/prometheus/client_golang/issues/1686)
- \[ENHANCEMENT] exp/api: Bubble up status code from writeResponse
[#&#8203;1823](https://redirect.github.com/prometheus/client_golang/issues/1823)
- \[ENHANCEMENT] collector/go: Update runtime metrics for Go v1.23 and
v1.24
[#&#8203;1833](https://redirect.github.com/prometheus/client_golang/issues/1833)
- \[BUGFIX] exp/api: client prompt return on context cancellation
[#&#8203;1729](https://redirect.github.com/prometheus/client_golang/issues/1729)

<details>
<summary>All Changes</summary>
* Update example test by @&#8203;SuperQ in
prometheus/client_golang#1770
* build(deps): bump golang.org/x/net from 0.34.0 to 0.36.0 in
/tutorials/whatsup by @&#8203;dependabot[bot] in
prometheus/client_golang#1776
* Synchronize common files from prometheus/prometheus by @&#8203;prombot
in prometheus/client_golang#1771
* Synchronize common files from prometheus/prometheus by @&#8203;prombot
in prometheus/client_golang#1778
* Synchronize common files from prometheus/prometheus by @&#8203;prombot
in prometheus/client_golang#1779
* build(deps): bump google.golang.org/protobuf from 1.36.5 to 1.36.6 in
/exp by @&#8203;dependabot[bot] in
prometheus/client_golang#1782
* build(deps): bump github.com/prometheus/common from 0.62.0 to 0.63.0
in /exp by @&#8203;dependabot[bot] in
prometheus/client_golang#1781
* build(deps): bump github.com/prometheus/common from 0.62.0 to 0.63.0
by @&#8203;dependabot[bot] in
prometheus/client_golang#1783
* build(deps): bump google.golang.org/protobuf from 1.36.5 to 1.36.6 by
@&#8203;dependabot[bot] in
prometheus/client_golang#1784
* build(deps): bump github.com/prometheus/procfs from 0.15.1 to 0.16.0
by @&#8203;dependabot[bot] in
prometheus/client_golang#1786
* chore: Upgrade golangci-lint to v2 by @&#8203;kakkoyun in
prometheus/client_golang#1789
* build(deps): bump the github-actions group across 1 directory with 3
updates by @&#8203;dependabot[bot] in
prometheus/client_golang#1790
* Synchronize common files from prometheus/prometheus by @&#8203;prombot
in prometheus/client_golang#1791
* Add `WrapCollectorWith` and `WrapCollectorWithPrefix` by
@&#8203;colega in prometheus/client_golang#1766
* feat(github-actions): add Go file change detection to golangci-lint
workflow by @&#8203;kakkoyun in
prometheus/client_golang#1794
* chore(ci): Fix flaky tests by @&#8203;kakkoyun in
prometheus/client_golang#1795
* build(deps): bump golang.org/x/net from 0.36.0 to 0.38.0 in
/tutorials/whatsup by @&#8203;dependabot[bot] in
prometheus/client_golang#1799
* test(registry): Add goleak-based goroutine leak detection by
@&#8203;surinkim in
prometheus/client_golang#1797
* build(deps): bump go.uber.org/goleak from 1.2.0 to 1.3.0 by
@&#8203;dependabot[bot] in
prometheus/client_golang#1806
* build(deps): bump the github-actions group with 2 updates by
@&#8203;dependabot[bot] in
prometheus/client_golang#1804
* Synchronize common files from prometheus/prometheus by @&#8203;prombot
in prometheus/client_golang#1809
* Add exemplars for native histograms by @&#8203;shivanthzen in
prometheus/client_golang#1686
* build(deps): bump golang.org/x/sys from 0.30.0 to 0.32.0 by
@&#8203;dependabot[bot] in
prometheus/client_golang#1807
* build(deps): bump github.com/prometheus/client_model from 0.6.1 to
0.6.2 by @&#8203;dependabot[bot] in
prometheus/client_golang#1805
* build(deps): bump github.com/prometheus/procfs from 0.16.0 to 0.16.1
by @&#8203;dependabot[bot] in
prometheus/client_golang#1808
* build(deps): bump golang.org/x/net from 0.35.0 to 0.38.0 by
@&#8203;dependabot[bot] in
prometheus/client_golang#1800
* Update supported Go versions by @&#8203;SuperQ in
prometheus/client_golang#1812
* Cleaup Go modules by @&#8203;SuperQ in
prometheus/client_golang#1813
* fix: client prompt return on context cancellation by @&#8203;umegbewe
in prometheus/client_golang#1729
* Simplify buf binary install by @&#8203;SuperQ in
prometheus/client_golang#1814
* Synchronize common files from prometheus/prometheus by @&#8203;prombot
in prometheus/client_golang#1815
* build(deps): bump the github-actions group with 5 updates by
@&#8203;dependabot[bot] in
prometheus/client_golang#1817
* Synchronize common files from prometheus/prometheus by @&#8203;prombot
in prometheus/client_golang#1821
* exp/api: Bubble up status code from writeResponse by
@&#8203;saswatamcode in
prometheus/client_golang#1823
* build(deps): bump github.com/prometheus/common from 0.64.0 to 0.65.0
by @&#8203;dependabot[bot] in
prometheus/client_golang#1827
* build(deps): bump github.com/prometheus/common from 0.64.0 to 0.65.0
in /exp by @&#8203;dependabot[bot] in
prometheus/client_golang#1828
* Synchronize common files from prometheus/prometheus by @&#8203;prombot
in prometheus/client_golang#1831
* Update runtime metrics for Go v1.23 and v1.24 by @&#8203;aknuds1 in
prometheus/client_golang#1833
* Fix `errNotImplemented` reference by @&#8203;aknuds1 in
prometheus/client_golang#1835
* build(deps): bump the github-actions group with 3 updates by
@&#8203;dependabot[bot] in
prometheus/client_golang#1826
* Synchronize common files from prometheus/prometheus by @&#8203;prombot
in prometheus/client_golang#1832
* Cut v1.23.0-rc.0 by @&#8203;vesari in
prometheus/client_golang#1837
* cut v1.23.0-rc.1 by @&#8203;vesari in
prometheus/client_golang#1842

</details>

#### New Contributors
* @&#8203;surinkim made their first
contributi[https://github.com/prometheus/client_golang/pull/1797](https://redirect.github.com/prometheus/client_golang/pull/1797)l/1797
* @&#8203;umegbewe made their first
contributi[https://github.com/prometheus/client_golang/pull/1729](https://redirect.github.com/prometheus/client_golang/pull/1729)l/1729
* @&#8203;aknuds1 made their first
contributi[https://github.com/prometheus/client_golang/pull/1833](https://redirect.github.com/prometheus/client_golang/pull/1833)l/1833

**Full Changelog**:
https://github.com/prometheus/client\_golang/compare/v1.22.0...v1.23.0

</details>

---

### Configuration

📅 **Schedule**: Branch creation - "on the first day of the month" (UTC),
Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you
are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR was generated by [Mend Renovate](https://mend.io/renovate/).
View the [repository job
log](https://developer.mend.io/github/jaegertracing/jaeger).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0MS40Ni4zIiwidXBkYXRlZEluVmVyIjoiNDEuNDYuMyIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOlsiY2hhbmdlbG9nOmRlcGVuZGVuY2llcyJdfQ==-->

Signed-off-by: Mend Renovate <bot@renovateapp.com>
yurishkuro pushed a commit to jaegertracing/jaeger that referenced this pull request Aug 1, 2025
This PR contains the following updates:

| Package | Change | Age | Confidence |
|---|---|---|---|
|
[github.com/prometheus/client_golang](https://redirect.github.com/prometheus/client_golang)
| `v1.22.0` -> `v1.23.0` |
[![age](https://developer.mend.io/api/mc/badges/age/go/github.com%2fprometheus%2fclient_golang/v1.23.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://developer.mend.io/api/mc/badges/confidence/go/github.com%2fprometheus%2fclient_golang/v1.22.0/v1.23.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|

---

### Release Notes

<details>
<summary>prometheus/client_golang
(github.com/prometheus/client_golang)</summary>

###
[`v1.23.0`](https://redirect.github.com/prometheus/client_golang/releases/tag/v1.23.0):
- 2025-07-30

[Compare
Source](https://redirect.github.com/prometheus/client_golang/compare/v1.22.0...v1.23.0)

- \[CHANGE] Minimum required Go version is now 1.23, only the two latest
Go versions are supported from now on.
[#&#8203;1812](https://redirect.github.com/prometheus/client_golang/issues/1812)
- \[FEATURE] Add WrapCollectorWith and WrapCollectorWithPrefix
[#&#8203;1766](https://redirect.github.com/prometheus/client_golang/issues/1766)
- \[FEATURE] Add exemplars for native histograms
[#&#8203;1686](https://redirect.github.com/prometheus/client_golang/issues/1686)
- \[ENHANCEMENT] exp/api: Bubble up status code from writeResponse
[#&#8203;1823](https://redirect.github.com/prometheus/client_golang/issues/1823)
- \[ENHANCEMENT] collector/go: Update runtime metrics for Go v1.23 and
v1.24
[#&#8203;1833](https://redirect.github.com/prometheus/client_golang/issues/1833)
- \[BUGFIX] exp/api: client prompt return on context cancellation
[#&#8203;1729](https://redirect.github.com/prometheus/client_golang/issues/1729)

<details>
<summary>All Changes</summary>
* Update example test by @&#8203;SuperQ in
prometheus/client_golang#1770
* build(deps): bump golang.org/x/net from 0.34.0 to 0.36.0 in
/tutorials/whatsup by @&#8203;dependabot[bot] in
prometheus/client_golang#1776
* Synchronize common files from prometheus/prometheus by @&#8203;prombot
in prometheus/client_golang#1771
* Synchronize common files from prometheus/prometheus by @&#8203;prombot
in prometheus/client_golang#1778
* Synchronize common files from prometheus/prometheus by @&#8203;prombot
in prometheus/client_golang#1779
* build(deps): bump google.golang.org/protobuf from 1.36.5 to 1.36.6 in
/exp by @&#8203;dependabot[bot] in
prometheus/client_golang#1782
* build(deps): bump github.com/prometheus/common from 0.62.0 to 0.63.0
in /exp by @&#8203;dependabot[bot] in
prometheus/client_golang#1781
* build(deps): bump github.com/prometheus/common from 0.62.0 to 0.63.0
by @&#8203;dependabot[bot] in
prometheus/client_golang#1783
* build(deps): bump google.golang.org/protobuf from 1.36.5 to 1.36.6 by
@&#8203;dependabot[bot] in
prometheus/client_golang#1784
* build(deps): bump github.com/prometheus/procfs from 0.15.1 to 0.16.0
by @&#8203;dependabot[bot] in
prometheus/client_golang#1786
* chore: Upgrade golangci-lint to v2 by @&#8203;kakkoyun in
prometheus/client_golang#1789
* build(deps): bump the github-actions group across 1 directory with 3
updates by @&#8203;dependabot[bot] in
prometheus/client_golang#1790
* Synchronize common files from prometheus/prometheus by @&#8203;prombot
in prometheus/client_golang#1791
* Add `WrapCollectorWith` and `WrapCollectorWithPrefix` by
@&#8203;colega in prometheus/client_golang#1766
* feat(github-actions): add Go file change detection to golangci-lint
workflow by @&#8203;kakkoyun in
prometheus/client_golang#1794
* chore(ci): Fix flaky tests by @&#8203;kakkoyun in
prometheus/client_golang#1795
* build(deps): bump golang.org/x/net from 0.36.0 to 0.38.0 in
/tutorials/whatsup by @&#8203;dependabot[bot] in
prometheus/client_golang#1799
* test(registry): Add goleak-based goroutine leak detection by
@&#8203;surinkim in
prometheus/client_golang#1797
* build(deps): bump go.uber.org/goleak from 1.2.0 to 1.3.0 by
@&#8203;dependabot[bot] in
prometheus/client_golang#1806
* build(deps): bump the github-actions group with 2 updates by
@&#8203;dependabot[bot] in
prometheus/client_golang#1804
* Synchronize common files from prometheus/prometheus by @&#8203;prombot
in prometheus/client_golang#1809
* Add exemplars for native histograms by @&#8203;shivanthzen in
prometheus/client_golang#1686
* build(deps): bump golang.org/x/sys from 0.30.0 to 0.32.0 by
@&#8203;dependabot[bot] in
prometheus/client_golang#1807
* build(deps): bump github.com/prometheus/client_model from 0.6.1 to
0.6.2 by @&#8203;dependabot[bot] in
prometheus/client_golang#1805
* build(deps): bump github.com/prometheus/procfs from 0.16.0 to 0.16.1
by @&#8203;dependabot[bot] in
prometheus/client_golang#1808
* build(deps): bump golang.org/x/net from 0.35.0 to 0.38.0 by
@&#8203;dependabot[bot] in
prometheus/client_golang#1800
* Update supported Go versions by @&#8203;SuperQ in
prometheus/client_golang#1812
* Cleaup Go modules by @&#8203;SuperQ in
prometheus/client_golang#1813
* fix: client prompt return on context cancellation by @&#8203;umegbewe
in prometheus/client_golang#1729
* Simplify buf binary install by @&#8203;SuperQ in
prometheus/client_golang#1814
* Synchronize common files from prometheus/prometheus by @&#8203;prombot
in prometheus/client_golang#1815
* build(deps): bump the github-actions group with 5 updates by
@&#8203;dependabot[bot] in
prometheus/client_golang#1817
* Synchronize common files from prometheus/prometheus by @&#8203;prombot
in prometheus/client_golang#1821
* exp/api: Bubble up status code from writeResponse by
@&#8203;saswatamcode in
prometheus/client_golang#1823
* build(deps): bump github.com/prometheus/common from 0.64.0 to 0.65.0
by @&#8203;dependabot[bot] in
prometheus/client_golang#1827
* build(deps): bump github.com/prometheus/common from 0.64.0 to 0.65.0
in /exp by @&#8203;dependabot[bot] in
prometheus/client_golang#1828
* Synchronize common files from prometheus/prometheus by @&#8203;prombot
in prometheus/client_golang#1831
* Update runtime metrics for Go v1.23 and v1.24 by @&#8203;aknuds1 in
prometheus/client_golang#1833
* Fix `errNotImplemented` reference by @&#8203;aknuds1 in
prometheus/client_golang#1835
* build(deps): bump the github-actions group with 3 updates by
@&#8203;dependabot[bot] in
prometheus/client_golang#1826
* Synchronize common files from prometheus/prometheus by @&#8203;prombot
in prometheus/client_golang#1832
* Cut v1.23.0-rc.0 by @&#8203;vesari in
prometheus/client_golang#1837
* cut v1.23.0-rc.1 by @&#8203;vesari in
prometheus/client_golang#1842

</details>

#### New Contributors
* @&#8203;surinkim made their first
contributi[https://github.com/prometheus/client_golang/pull/1797](https://redirect.github.com/prometheus/client_golang/pull/1797)l/1797
* @&#8203;umegbewe made their first
contributi[https://github.com/prometheus/client_golang/pull/1729](https://redirect.github.com/prometheus/client_golang/pull/1729)l/1729
* @&#8203;aknuds1 made their first
contributi[https://github.com/prometheus/client_golang/pull/1833](https://redirect.github.com/prometheus/client_golang/pull/1833)l/1833

**Full Changelog**:
https://github.com/prometheus/client\_golang/compare/v1.22.0...v1.23.0

</details>

---

### Configuration

📅 **Schedule**: Branch creation - "on the first day of the month" (UTC),
Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you
are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR was generated by [Mend Renovate](https://mend.io/renovate/).
View the [repository job
log](https://developer.mend.io/github/jaegertracing/jaeger).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0MS40Ni4zIiwidXBkYXRlZEluVmVyIjoiNDEuNDYuMyIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOlsiY2hhbmdlbG9nOmRlcGVuZGVuY2llcyJdfQ==-->

Signed-off-by: Mend Renovate <bot@renovateapp.com>
This was referenced Aug 2, 2025
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.

3 participants