Skip to content

Added is_retriable() to FlussError#422

Open
toxicteddy00077 wants to merge 1 commit intoapache:mainfrom
toxicteddy00077:fluss-retri-error
Open

Added is_retriable() to FlussError#422
toxicteddy00077 wants to merge 1 commit intoapache:mainfrom
toxicteddy00077:fluss-retri-error

Conversation

@toxicteddy00077
Copy link

Purpose

Linked issue: close #320

Description

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

@toxicteddy00077
Copy link
Author

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

Copy link
Contributor

@leekeiabstraction leekeiabstraction left a comment

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


/// 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
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
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
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
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
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
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

Copy link
Contributor

@fresh-borzoni fresh-borzoni left a comment

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
Contributor

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?

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

3 participants