Skip to content

bitreq: use Duration for Request::with_timeout#642

Open
luisschwab wants to merge 1 commit into
rust-bitcoin:masterfrom
luisschwab:bitreq/use-duration-for-timeout
Open

bitreq: use Duration for Request::with_timeout#642
luisschwab wants to merge 1 commit into
rust-bitcoin:masterfrom
luisschwab:bitreq/use-duration-for-timeout

Conversation

@luisschwab

Copy link
Copy Markdown

Closes #641

Uses Duration for Reqwest::with_timeout, since u64 leaves a bit of room for doubt.

@tnull tnull left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Generally makes sense to me.

Comment thread jsonrpc/src/http/bitreq_http.rs Outdated
let secs = self.timeout.as_secs();
if secs == 0 && self.timeout > Duration::from_secs(0) {
1
Duration::from_secs(1)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Codex:

  • [P1] /home/tnull/workspace/corepc-pr-642/jsonrpc/Cargo.toml:41 still allows bitreq = "0.3.5", but jsonrpc now calls the new with_timeout(Duration) API. Published or locked downstream builds can still resolve an older bitreq with with_timeout(u64) and fail to compile when bitreq_http or
    bitreq_http_async is enabled. Bump the dependency to the first bitreq release containing this breaking API, likely alongside a bitreq version bump.

@luisschwab luisschwab Jun 24, 2026

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Should we bump bitreq to v0.3.8 (or maybe to v0.4.0, since this is a breaking change, although minimal) in this same PR?

Bumping bitreq to v0.3.7 on jsonrpc would be of no effect, since this change is still unreleased.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Easier to keep track of that way imo, but up to you.

@tcharding tcharding Jul 6, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

We don't need to release this immediately, right? Why don't we just bump the version when we go to release?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

OP is not correct IIUC, we have a path section in the dep.

Comment thread jsonrpc/src/http/bitreq_http.rs Outdated
Comment thread bitreq/CHANGELOG.md Outdated
@luisschwab luisschwab force-pushed the bitreq/use-duration-for-timeout branch from dfdaf26 to c5e4d78 Compare June 24, 2026 14:50
satsfy

This comment was marked as outdated.

Comment thread bitreq/src/lib.rs Outdated

@tcharding tcharding left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

ACK c5e4d78 - sans the import thing.

@luisschwab luisschwab force-pushed the bitreq/use-duration-for-timeout branch from c5e4d78 to 6734bc8 Compare July 6, 2026 22:45
@luisschwab

Copy link
Copy Markdown
Author

@tcharding fixed

@tcharding tcharding left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

ACK 6734bc8

@tcharding

Copy link
Copy Markdown
Member

Will wait for one of the others to ack before merging. Thanks @luisschwab.

@satsfy satsfy left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

tACK 6734bc8

Since my last review, the CI has been fixed, and no functional changes have been made. Tested the new duration locally.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bitreq: use Duration for timeouts

5 participants