Skip to content

fix(client): do not retry timed-out non-idempotent private POSTs - #51

Closed
SashaMIT wants to merge 1 commit into
krakenfx:mainfrom
SashaMIT:fix/no-timeout-retry-nonidempotent-private-post
Closed

SashaMIT wants to merge 1 commit into
krakenfx:mainfrom
SashaMIT:fix/no-timeout-retry-nonidempotent-private-post

Conversation

@SashaMIT

Copy link
Copy Markdown
Contributor

Summary

private_post, private_post_json, and private_post_raw take an idempotent flag. 5xx retries already honor it. Transport retries did not.

is_transient treats connect and timeout the same. A connect failure never reached Kraken. A 30s request timeout can fire after AddOrder or Withdraw already executed. The retry uses a fresh nonce and no default cl_ord_id, so the venue places a second order.

When idempotent is false, only connect failures retry.

Test plan

  • cargo test --lib non_idempotent_timeout green
  • Revert-tested: timeout + idempotent=false used to retry via is_transient

Made with Cursor

A request timeout can fire after Kraken already placed the order or
withdrawal. Connect failures still retry because they never reached
the venue.
@MaxOxide

Copy link
Copy Markdown
Contributor

Thanks @SashaMIT ! This is fixed in v0.5.0. A timed-out order, cancel, withdrawal or transfer is never sent again. If it may have executed, the error has "verify_first": true. The REST client moved to a new crate in this release, so we ported your fix there and added you as co-author on the release commit. Closing this PR.

@MaxOxide MaxOxide closed this Oct 29, 2026
needaccforwhonix pushed a commit to needaccforwhonix/kraken-cli that referenced this pull request Nov 7, 2026
Sign in from the browser to create a restricted, expiring Spot API key.
The MCP server and the REPL ship as their own binaries, kraken-mcp and
kraken-shell, installed next to kraken. A paper strategy can go live in
a budget-fenced workspace, and a finished session packages as a recipe.
A timed-out order, cancel, withdrawal or transfer is never resent, and
an envelope that may hide an execution carries "verify_first": true.

Upgrading from 0.4.1 needs action from scripts, agents and MCP clients:
see CHANGELOG.md under 0.5.0.

Includes community fixes from krakenfx#50, krakenfx#51, krakenfx#54, krakenfx#55 and krakenfx#56.

Co-authored-by: theghostmac <83423188+theghostmac@users.noreply.github.com>
Co-authored-by: SashaMIT <33847880+SashaMIT@users.noreply.github.com>
Co-authored-by: sashaphmn <122053040+sashaphmn@users.noreply.github.com>
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