Skip to content

parent_fetch: Make RPC timeout configurable and increase default to 15 seconds - #38

Open
luke-jr wants to merge 2 commits into
CONVOYMining:masterfrom
luke-jr:parent_fetch_timeout
Open

luke-jr wants to merge 2 commits into
CONVOYMining:masterfrom
luke-jr:parent_fetch_timeout

Conversation

@luke-jr

@luke-jr luke-jr commented Oct 11, 2026

Copy link
Copy Markdown

Seeing occasional parent-fetch timeouts on CONVOY, so give bitcoind a bit more time.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 Changes recommended

Authentication retries can exceed the configured maximum, and the new test can hang indefinitely on regressions.

2 open findings
What changed in this PR

Adds a configurable parent-fetch RPC timeout, increasing the default from 5 to 15 seconds.

Changes:

  • Adds and validates the parent_fetch_timeout_seconds setting.
  • Extends JSON-RPC calls to accept custom timeouts.
  • Tests successful and timed-out parent fetches.
File Description
src/​datum_conf.c Defines and validates the timeout setting.
src/​datum_conf.h Stores the configured timeout.
src/​datum_jsonrpc.c Implements custom RPC timeouts.
src/​datum_jsonrpc.h Exposes the timeout-aware RPC function.
src/​datum_parent_fetch.c Applies the configured timeout.
src/​datum_parent_fetch_tests.c Tests success and timeout behavior.

🧠 Review effort: Balanced


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread src/datum_jsonrpc.c
// Authentication failure using cookie; reload cookie file and try again
if (!update_rpc_cookie(cfg)) return NULL;
return json_rpc_call(curl, cfg->bitcoind_rpcurl, cfg->bitcoind_rpcuserpass, rpc_req);
return json_rpc_call_full(curl, cfg->bitcoind_rpcurl, cfg->bitcoind_rpcuserpass, rpc_req, NULL, NULL, timeout_seconds);

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.

I think this behaviour is acceptable. The parent fetch is just part of a longer process, and this timeout is for the fetch itself.

Comment on lines +83 to +85
for (unsigned request_index = 0; request_index < 2; ++request_index) {
const int client = accept(server->listen_fd, NULL, NULL);
if (client < 0) return NULL;
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