Skip to content

Comments

CURATOR-677: Complete BackgroundCallback if sub operation failed or cancelled#467

Merged
kezhuw merged 2 commits intoapache:masterfrom
kezhuw:CURATOR-677-complete-background-calback-with-auxiliary-sub-operations
Aug 15, 2023
Merged

CURATOR-677: Complete BackgroundCallback if sub operation failed or cancelled#467
kezhuw merged 2 commits intoapache:masterfrom
kezhuw:CURATOR-677-complete-background-calback-with-auxiliary-sub-operations

Conversation

@kezhuw
Copy link
Member

@kezhuw kezhuw commented Jun 12, 2023

Currently, some background operations use auxiliary sub operations to
complete task in case of primary conditions are not satisfied. But most
of these sub operations count only success path, so they will hang
BackgroundCallback if they are failed or cancelled due to framework
closed.

This is the leftover of CURATOR-673(#464).

kezhuw added 2 commits June 12, 2023 11:22
…ancelled

Currently, some background operations use auxiliary sub operations to
complete task in case of primary conditions are not satisfied. But most
of these sub operations count only success path, so they will hang
`BackgroundCallback` if they are failed or cancelled due to framework
closed.

This is the leftover of [CURATOR-673][](apache#464).

[CURATOR-673]: https://issues.apache.org/jira/browse/CURATOR-673
Copy link
Member Author

@kezhuw kezhuw left a comment

Choose a reason for hiding this comment

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

I deliberately split this pr into two commits, first for test case and second for code fix. Most newly added tests could not even resist one run in "repeat until failure" mode. All new tests resist 100 runs without failure in local.

if (!client.getZookeeperClient().getRetryPolicy().allowRetry(e)) {
sendBackgroundResponse(
client, e.code().intValue(), e.getPath(), null, null, null, mainOperationAndData);
throw e;
Copy link
Member Author

Choose a reason for hiding this comment

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

These two statements will complete twice of BackgroundCallback. abortOperation introduced in #464 will complete this anyway.

Besides above, the deleted call omitted OperationAndData.context.

statCallback,
backgrounding.getContext());
} catch (KeeperException e) {
// ignore
Copy link
Member Author

Choose a reason for hiding this comment

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

I don't know how this could happen. But if it happen in real, it should go to exception path instead of ignore.

@kezhuw kezhuw requested review from eolivelli and tisonkun August 7, 2023 09:21
Copy link
Member

@tisonkun tisonkun left a comment

Choose a reason for hiding this comment

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

Thank you!

+1 for merging.

@kezhuw kezhuw merged commit bf58743 into apache:master Aug 15, 2023
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