Skip to content

Added is_retriable() to FlussError#422

Merged
luoyuxia merged 1 commit into
apache:mainfrom
toxicteddy00077:fluss-retri-error
Mar 11, 2026
Merged

Added is_retriable() to FlussError#422
luoyuxia merged 1 commit into
apache:mainfrom
toxicteddy00077:fluss-retri-error

Conversation

@toxicteddy00077

Copy link
Copy Markdown
Contributor

Purpose

Linked issue: close #320

Description

Added basic is_retriable() implementation, similar to Java's RetriableException .

@toxicteddy00077

Copy link
Copy Markdown
Contributor Author

I ran some tests and didnt see any propagation issues, let me know if I missed something

@leekeiabstraction leekeiabstraction 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.

TY for the PR, left a question

Comment thread bindings/cpp/include/fluss.hpp Outdated

/// Returns true if retrying the request may succeed. Similar toJava's RetriableException hierarchy.
static constexpr bool IsRetriable(int32_t code) {
return code == NETWORK_EXCEPTION || code == NOT_LEADER_OR_FOLLOWER ||

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.

Can you point me to where error code for retriable errors are defined on java side?

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.

I do not see the equivalent Java exceptions for the following (not exhaustive)

  • INVALID_COORDINATOR_EXCEPTION
  • FENCED_LEADER_EPOCH_EXCEPTION
  • RETRIABLE_AUTHENTICATE_EXCEPTION

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

feedback much appreciated,I should checked the fluss source myself. I asked an LLM to enumerate all the exceptions the extend RetriableException, but it seems to have given for ApiException and others as well. My apologies.

Apart from this having looked at the source myself ,there were a few others i think I should add, such as CorruptMessageException and SchemaNotExistException. let me know since i think the rest are correct

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I do not see the equivalent Java exceptions for the following (not exhaustive)

* INVALID_COORDINATOR_EXCEPTION

* FENCED_LEADER_EPOCH_EXCEPTION

* RETRIABLE_AUTHENTICATE_EXCEPTION

apart form these three and FencedTieringEpochException, the others have been kept similar to Java

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.

STORAGE_EXCEPTION seems to be missing too, can you push a new commit?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

added :

  1. CorruptMessage
  2. SchemaNotExist
  3. CorruptRecordException
  4. StorageException

and removed the incorrect ones

@fresh-borzoni fresh-borzoni 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.

@toxicteddy00077 TY for the PR, left comment, PTAL
LogStorageException (code 10)
KvStorageException (code 11)

The are subclasses of StorageException, so should be retriable


/// Returns true if retrying the request may succeed. Mirrors Java's RetriableException hierarchy.
static constexpr bool IsRetriable(int32_t code) {
return code == NETWORK_EXCEPTION || code == CORRUPT_MESSAGE ||

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.

shall we update docs, btw?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

have a look and let me know

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.

@toxicteddy00077 I only see cpp docs updated.
What about rust, python?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

yeah thats why I asked you to have a look. Just wanted to confirm if this was fine. Now I'll make the updates ASAP thanks

@fresh-borzoni fresh-borzoni 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.

@toxicteddy00077 Ty, LGTM

@luoyuxia luoyuxia 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.

Thanks. LGTM!

@luoyuxia luoyuxia merged commit 3d5c9a0 into apache:main Mar 11, 2026
9 checks passed
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.

Add is_retriable() to FlussError

4 participants