Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add EmitFailureHandler.busyLoop flavor #2943

Merged
merged 5 commits into from
Mar 4, 2022

Conversation

Animesh27
Copy link
Contributor

@Animesh27 Animesh27 commented Feb 28, 2022

Adding OptimisticEmitFailureHandler for retrying and busy looping till a specified duration to overcome transient failure.

Fixes #2883.

…l a specified duration to overcome transient failure.
@Animesh27 Animesh27 requested a review from a team as a code owner February 28, 2022 22:42
@pivotal-cla
Copy link

@Animesh27 Please sign the Contributor License Agreement!

Click here to manually synchronize the status of this Pull Request.

See the FAQ for frequently asked questions.

1 similar comment
@pivotal-cla
Copy link

@Animesh27 Please sign the Contributor License Agreement!

Click here to manually synchronize the status of this Pull Request.

See the FAQ for frequently asked questions.

@Animesh27
Copy link
Contributor Author

@simonbasle I have implemented an OptimisticEmitFailureHandler with the state (duration) where we can get the busy looping just by returning true. Just wanted to check if this is the implementation you are looking for.?

Note - This is a draft version of the PR.

@pivotal-cla
Copy link

@Animesh27 Thank you for signing the Contributor License Agreement!

@simonbasle
Copy link
Member

@Animesh27 yeah that's what I had in mind 👍

@simonbasle
Copy link
Member

@Animesh27 you just need to add tests and document the feature (with the caveats mentioned in the issue) and this should be good to go 😄

@hepin1989 does that solve your original issue?

}
@Override
public boolean onEmitFailure(SignalType signalType, Sinks.EmitResult emitResult) {
return emitResult.equals(Sinks.EmitResult.FAIL_NON_SERIALIZED) && (System.nanoTime() > duration);
Copy link
Contributor

Choose a reason for hiding this comment

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

Cool!

@He-Pin
Copy link
Contributor

He-Pin commented Mar 1, 2022

@simonbasle Yes ,that What I was using in my code too:) and thanks @Animesh27

…l a specified duration to overcome transient failure.
…actor-core into EmitHandler-BusyTry

# Conflicts:
#	reactor-core/src/main/java/reactor/core/publisher/OptimisticEmitFailureHandler.java
@Animesh27
Copy link
Contributor Author

@simonbasle Updated with docs and tests.

Copy link
Member

@simonbasle simonbasle left a comment

Choose a reason for hiding this comment

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

thanks for the changes @Animesh27. I have requested a few further changes to polish all that, align with our usual design and avoid a new public class, this PR is getting closer to merge 👍

Copy link
Member

@simonbasle simonbasle left a comment

Choose a reason for hiding this comment

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

LGTM, 1 small nitpick on code formatting but otherwise this is good to go

@simonbasle
Copy link
Member

eh japicmp complains about the new static method in the interface :(
let me have a look

@simonbasle simonbasle added this to the 3.4.16 milestone Mar 3, 2022
@simonbasle simonbasle added the type/enhancement A general enhancement label Mar 3, 2022
@simonbasle
Copy link
Member

simonbasle commented Mar 3, 2022 via email

@simonbasle simonbasle changed the title Adding OptimisticEmitFailureHandler Add EmitFailureHandler.busyLoop flavor Mar 4, 2022
@simonbasle simonbasle merged commit 62aa692 into reactor:3.4.x Mar 4, 2022
@reactorbot
Copy link

@simonbasle this PR seems to have been merged on a maintenance branch, please ensure the change is merge-forwarded to intermediate maintenance branches and up to main 🙇

gcf-merge-on-green bot pushed a commit to GoogleCloudPlatform/cloud-sql-jdbc-socket-factory that referenced this pull request Mar 25, 2022
….16 (#778)

[![WhiteSource Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
| [io.projectreactor:reactor-core](https://togithub.com/reactor/reactor-core) | `3.4.15` -> `3.4.16` | [![age](https://badges.renovateapi.com/packages/maven/io.projectreactor:reactor-core/3.4.16/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/io.projectreactor:reactor-core/3.4.16/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/io.projectreactor:reactor-core/3.4.16/compatibility-slim/3.4.15)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/io.projectreactor:reactor-core/3.4.16/confidence-slim/3.4.15)](https://docs.renovatebot.com/merge-confidence/) |

---

### Release Notes

<details>
<summary>reactor/reactor-core</summary>

### [`v3.4.16`](https://togithub.com/reactor/reactor-core/releases/v3.4.16)

[Compare Source](https://togithub.com/reactor/reactor-core/compare/v3.4.15...v3.4.16)

Reactor-Core `3.4.16` is part of **`2020.0.17` Release Train (`Europium` SR17)**.

This service release contains a few bugfixes and improvements.

#### What's Changed

##### ✨ New features and improvements

-   Improve BoundedElasticScheduler to be less blocking by [@&#8203;simonbasle](https://togithub.com/simonbasle) in [reactor/reactor-core#2909
-   Add EmitFailureHandler.busyLoop flavor by [@&#8203;Animesh27](https://togithub.com/Animesh27) in [reactor/reactor-core#2943

##### 🐞 Bug fixes

-   Fix Mono.then not cancelling between Callable sources by [@&#8203;simonbasle](https://togithub.com/simonbasle) in [reactor/reactor-core#2934

##### 📖 Documentation, Tests and Build

-   Update Gradle to v7.4 in [reactor/reactor-core#2922
-   \[doc] Correct flux subscribe example in faq by [@&#8203;liukun2634](https://togithub.com/liukun2634) in [reactor/reactor-core#2924
-   Show how-to-fix hints in CI when preliminary steps fail (check of license headers, api compatibility) by [@&#8203;simonbasle](https://togithub.com/simonbasle) in [reactor/reactor-core#2932
-   \[guide] Remove ref to Swing/SwtScheduler in addons appendix by [@&#8203;simonbasle](https://togithub.com/simonbasle) in [reactor/reactor-core#2959
-   \[build] Have jcstress part of slowerChecks by [@&#8203;simonbasle](https://togithub.com/simonbasle) in [reactor/reactor-core#2958

##### 🆙 Dependency Upgrades

-   Update plugin spotless to v6.3.0 in [reactor/reactor-core#2925
-   Update plugin bnd to v6.2.0 in [reactor/reactor-core#2941
-   Update dependency org.awaitility:awaitility to v4.2.0 in [reactor/reactor-core#2945
-   Update dependency ch.qos.logback:logback-classic to v1.2.11 in [reactor/reactor-core#2946
-   Update dependency com.tngtech.archunit:archunit to v0.23.1 in [reactor/reactor-core#2940
-   Update plugin japicmp to v0.4.0 in [reactor/reactor-core#2948
-   Update dependency org.mockito:mockito-core to v4.4.0 in [reactor/reactor-core#2951
-   Update plugin download to v5.0.2 in [reactor/reactor-core#2950

#### New Contributors

-   [@&#8203;Animesh27](https://togithub.com/Animesh27) made their first contribution in [reactor/reactor-core#2943 👍

**Full Changelog**: reactor/reactor-core@v3.4.15...v3.4.16

</details>

---

### Configuration

📅 **Schedule**: "after 8am on Friday,before 12pm on Friday" (UTC).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, click this checkbox.

---

This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/GoogleCloudPlatform/cloud-sql-jdbc-socket-factory).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/enhancement A general enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add BUSY_TRY to EmitFailureHandler?
5 participants