-
Notifications
You must be signed in to change notification settings - Fork 7.6k
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
3.x: Standardize MissingBackpressureException message, introduce QueueOverflowException #7459
3.x: Standardize MissingBackpressureException message, introduce QueueOverflowException #7459
Conversation
Codecov Report
@@ Coverage Diff @@
## 3.x #7459 +/- ##
============================================
- Coverage 99.55% 99.54% -0.02%
- Complexity 6781 6786 +5
============================================
Files 751 752 +1
Lines 47482 47489 +7
Branches 6378 6379 +1
============================================
+ Hits 47271 47272 +1
- Misses 93 97 +4
- Partials 118 120 +2
📣 Codecov can now indicate which changes are the most critical in Pull Requests. Learn more |
* without synchronization. Rarely, it is an indication of bugs inside RxJava | ||
* @since 3.1.6 | ||
*/ | ||
public static final String QUEUE_OVERFLOW_MESSAGE = "Queue overflow due to illegal concurrent onNext calls or a bug in RxJava"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These could be private though, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
3rd party implementations should be able to verify they got this exact message:
assertEquals(ex.getMessage(), MissingBackpressureException.QUEUE_OVERFLOW_MESSAGE);
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm should not we then just have two different exceptions both having only one public constructor which contains the exact message and then you simply check for its type which is superior than the String message?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Alright, let's introduce a separate exception.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
* Constructs a QueueOverflowException with the given message but no cause. | ||
* @param message the error message | ||
*/ | ||
public QueueOverflowException(String message) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why would we need this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In case 3rd party users would want to have a custom message.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Alright!
[](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [io.reactivex.rxjava3:rxjava](https://togithub.com/ReactiveX/RxJava) | `3.1.5` -> `3.1.6` | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | --- ### ⚠ Dependency Lookup Warnings ⚠ Warnings were logged while processing this repo. Please check the Dependency Dashboard for more information. --- ### Release Notes <details> <summary>ReactiveX/RxJava</summary> ### [`v3.1.6`](https://togithub.com/ReactiveX/RxJava/releases/tag/v3.1.6) [Maven](http://search.maven.org/#artifactdetails%7Cio.reactivex.rxjava3%7Crxjava%7C3.1.6%7C) [JavaDocs](http://reactivex.io/RxJava/3.x/javadoc/3.1.6) ##### API changes - Add an overload to `throttleLatest` operator with an `onDropped` callback. (<a href='https://github.com/ReactiveX/RxJava/issues/7457'>[#​7457](https://togithub.com/ReactiveX/RxJava/issues/7457)</a>) - Add an overload to `throttleFirst` operator with an `onDropped` callback. (<a href='https://github.com/ReactiveX/RxJava/issues/7482'>[#​7482](https://togithub.com/ReactiveX/RxJava/issues/7482)</a>) - Add an overload to `throttleLast` operator with an `onDropped` callback. (<a href='https://github.com/ReactiveX/RxJava/issues/7488'>[#​7488](https://togithub.com/ReactiveX/RxJava/issues/7488)</a>) - Add an overload to `throttleWithTimeout` operator with an `onDropped` callback. (<a href='https://github.com/ReactiveX/RxJava/issues/7510'>[#​7510](https://togithub.com/ReactiveX/RxJava/issues/7510)</a>) ##### Bugfixes - Fix a race condition in `Single.timeout` that prevented the timeout signal from happening. (<a href='https://github.com/ReactiveX/RxJava/issues/7515'>[#​7515](https://togithub.com/ReactiveX/RxJava/issues/7515)</a>) ##### Documentation - Fix formatting in `TestObserver/Consumer/Subscriber` javadoc html. (<a href='https://github.com/ReactiveX/RxJava/issues/7442'>[#​7442](https://togithub.com/ReactiveX/RxJava/issues/7442)</a>) - Fix typo in `BehaviorSubject.java`. (<a href='https://github.com/ReactiveX/RxJava/issues/7452'>[#​7452](https://togithub.com/ReactiveX/RxJava/issues/7452)</a>) - Fix grammar about cancellation in `Schedulers` javadoc. (<a href='https://github.com/ReactiveX/RxJava/issues/7453'>[#​7453](https://togithub.com/ReactiveX/RxJava/issues/7453)</a>) - Change `@coded` tag to `@code` tag. (<a href='https://github.com/ReactiveX/RxJava/issues/7463'>[#​7463](https://togithub.com/ReactiveX/RxJava/issues/7463)</a>) - Fix `fromCompletionStage` javadoc. (<a href='https://github.com/ReactiveX/RxJava/issues/7508'>[#​7508](https://togithub.com/ReactiveX/RxJava/issues/7508)</a>) ##### Other - Add missing `@NonNull` annotation to `Maybe` type argument. (<a href='https://github.com/ReactiveX/RxJava/issues/7436'>[#​7436](https://togithub.com/ReactiveX/RxJava/issues/7436)</a>) - Remove redundant interface declarations. (<a href='https://github.com/ReactiveX/RxJava/issues/7438'>[#​7438](https://togithub.com/ReactiveX/RxJava/issues/7438)</a>) - Standardize `MissingBackpressureException` message, introduce `QueueOverflowException`. (<a href='https://github.com/ReactiveX/RxJava/issues/7459'>[#​7459](https://togithub.com/ReactiveX/RxJava/issues/7459)</a>) - Update `Flowable.throttleLatest` `MissingBackpressureException` message. (<a href='https://github.com/ReactiveX/RxJava/issues/7460'>[#​7460](https://togithub.com/ReactiveX/RxJava/issues/7460)</a>) - Fix cancellation order in `throttleFirst`. (<a href='https://github.com/ReactiveX/RxJava/issues/7484'>[#​7484](https://togithub.com/ReactiveX/RxJava/issues/7484)</a>) </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, 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, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/Goooler/DemoApp). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNC4xMDUuMyIsInVwZGF0ZWRJblZlciI6IjM0LjEwNS4zIn0=--> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [io.reactivex.rxjava3:rxjava](https://togithub.com/ReactiveX/RxJava) | dependencies | patch | `3.1.5` -> `3.1.6` | --- ### Release Notes <details> <summary>ReactiveX/RxJava</summary> ### [`v3.1.6`](https://togithub.com/ReactiveX/RxJava/releases/tag/v3.1.6) [Maven](http://search.maven.org/#artifactdetails%7Cio.reactivex.rxjava3%7Crxjava%7C3.1.6%7C) [JavaDocs](http://reactivex.io/RxJava/3.x/javadoc/3.1.6) ##### API changes - Add an overload to `throttleLatest` operator with an `onDropped` callback. (<a href='https://github.com/ReactiveX/RxJava/issues/7457'>[#​7457](https://togithub.com/ReactiveX/RxJava/issues/7457)</a>) - Add an overload to `throttleFirst` operator with an `onDropped` callback. (<a href='https://github.com/ReactiveX/RxJava/issues/7482'>[#​7482](https://togithub.com/ReactiveX/RxJava/issues/7482)</a>) - Add an overload to `throttleLast` operator with an `onDropped` callback. (<a href='https://github.com/ReactiveX/RxJava/issues/7488'>[#​7488](https://togithub.com/ReactiveX/RxJava/issues/7488)</a>) - Add an overload to `throttleWithTimeout` operator with an `onDropped` callback. (<a href='https://github.com/ReactiveX/RxJava/issues/7510'>[#​7510](https://togithub.com/ReactiveX/RxJava/issues/7510)</a>) ##### Bugfixes - Fix a race condition in `Single.timeout` that prevented the timeout signal from happening. (<a href='https://github.com/ReactiveX/RxJava/issues/7515'>[#​7515](https://togithub.com/ReactiveX/RxJava/issues/7515)</a>) ##### Documentation - Fix formatting in `TestObserver/Consumer/Subscriber` javadoc html. (<a href='https://github.com/ReactiveX/RxJava/issues/7442'>[#​7442](https://togithub.com/ReactiveX/RxJava/issues/7442)</a>) - Fix typo in `BehaviorSubject.java`. (<a href='https://github.com/ReactiveX/RxJava/issues/7452'>[#​7452](https://togithub.com/ReactiveX/RxJava/issues/7452)</a>) - Fix grammar about cancellation in `Schedulers` javadoc. (<a href='https://github.com/ReactiveX/RxJava/issues/7453'>[#​7453](https://togithub.com/ReactiveX/RxJava/issues/7453)</a>) - Change `@coded` tag to `@code` tag. (<a href='https://github.com/ReactiveX/RxJava/issues/7463'>[#​7463](https://togithub.com/ReactiveX/RxJava/issues/7463)</a>) - Fix `fromCompletionStage` javadoc. (<a href='https://github.com/ReactiveX/RxJava/issues/7508'>[#​7508](https://togithub.com/ReactiveX/RxJava/issues/7508)</a>) ##### Other - Add missing `@NonNull` annotation to `Maybe` type argument. (<a href='https://github.com/ReactiveX/RxJava/issues/7436'>[#​7436](https://togithub.com/ReactiveX/RxJava/issues/7436)</a>) - Remove redundant interface declarations. (<a href='https://github.com/ReactiveX/RxJava/issues/7438'>[#​7438](https://togithub.com/ReactiveX/RxJava/issues/7438)</a>) - Standardize `MissingBackpressureException` message, introduce `QueueOverflowException`. (<a href='https://github.com/ReactiveX/RxJava/issues/7459'>[#​7459](https://togithub.com/ReactiveX/RxJava/issues/7459)</a>) - Update `Flowable.throttleLatest` `MissingBackpressureException` message. (<a href='https://github.com/ReactiveX/RxJava/issues/7460'>[#​7460](https://togithub.com/ReactiveX/RxJava/issues/7460)</a>) - Fix cancellation order in `throttleFirst`. (<a href='https://github.com/ReactiveX/RxJava/issues/7484'>[#​7484](https://togithub.com/ReactiveX/RxJava/issues/7484)</a>) </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, 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 [Renovate Bot](https://togithub.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzMi4xOTAuNiIsInVwZGF0ZWRJblZlciI6IjMyLjE5MC42In0=-->
This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [io.reactivex.rxjava3:rxjava](https://togithub.com/ReactiveX/RxJava) | dependencies | patch | `3.1.5` -> `3.1.6` | --- ### Release Notes <details> <summary>ReactiveX/RxJava</summary> ### [`v3.1.6`](https://togithub.com/ReactiveX/RxJava/releases/tag/v3.1.6) [Maven](http://search.maven.org/#artifactdetails%7Cio.reactivex.rxjava3%7Crxjava%7C3.1.6%7C) [JavaDocs](http://reactivex.io/RxJava/3.x/javadoc/3.1.6) ##### API changes - Add an overload to `throttleLatest` operator with an `onDropped` callback. (<a href='https://github.com/ReactiveX/RxJava/issues/7457'>[#​7457](https://togithub.com/ReactiveX/RxJava/issues/7457)</a>) - Add an overload to `throttleFirst` operator with an `onDropped` callback. (<a href='https://github.com/ReactiveX/RxJava/issues/7482'>[#​7482](https://togithub.com/ReactiveX/RxJava/issues/7482)</a>) - Add an overload to `throttleLast` operator with an `onDropped` callback. (<a href='https://github.com/ReactiveX/RxJava/issues/7488'>[#​7488](https://togithub.com/ReactiveX/RxJava/issues/7488)</a>) - Add an overload to `throttleWithTimeout` operator with an `onDropped` callback. (<a href='https://github.com/ReactiveX/RxJava/issues/7510'>[#​7510](https://togithub.com/ReactiveX/RxJava/issues/7510)</a>) ##### Bugfixes - Fix a race condition in `Single.timeout` that prevented the timeout signal from happening. (<a href='https://github.com/ReactiveX/RxJava/issues/7515'>[#​7515](https://togithub.com/ReactiveX/RxJava/issues/7515)</a>) ##### Documentation - Fix formatting in `TestObserver/Consumer/Subscriber` javadoc html. (<a href='https://github.com/ReactiveX/RxJava/issues/7442'>[#​7442](https://togithub.com/ReactiveX/RxJava/issues/7442)</a>) - Fix typo in `BehaviorSubject.java`. (<a href='https://github.com/ReactiveX/RxJava/issues/7452'>[#​7452](https://togithub.com/ReactiveX/RxJava/issues/7452)</a>) - Fix grammar about cancellation in `Schedulers` javadoc. (<a href='https://github.com/ReactiveX/RxJava/issues/7453'>[#​7453](https://togithub.com/ReactiveX/RxJava/issues/7453)</a>) - Change `@coded` tag to `@code` tag. (<a href='https://github.com/ReactiveX/RxJava/issues/7463'>[#​7463](https://togithub.com/ReactiveX/RxJava/issues/7463)</a>) - Fix `fromCompletionStage` javadoc. (<a href='https://github.com/ReactiveX/RxJava/issues/7508'>[#​7508](https://togithub.com/ReactiveX/RxJava/issues/7508)</a>) ##### Other - Add missing `@NonNull` annotation to `Maybe` type argument. (<a href='https://github.com/ReactiveX/RxJava/issues/7436'>[#​7436](https://togithub.com/ReactiveX/RxJava/issues/7436)</a>) - Remove redundant interface declarations. (<a href='https://github.com/ReactiveX/RxJava/issues/7438'>[#​7438](https://togithub.com/ReactiveX/RxJava/issues/7438)</a>) - Standardize `MissingBackpressureException` message, introduce `QueueOverflowException`. (<a href='https://github.com/ReactiveX/RxJava/issues/7459'>[#​7459](https://togithub.com/ReactiveX/RxJava/issues/7459)</a>) - Update `Flowable.throttleLatest` `MissingBackpressureException` message. (<a href='https://github.com/ReactiveX/RxJava/issues/7460'>[#​7460](https://togithub.com/ReactiveX/RxJava/issues/7460)</a>) - Fix cancellation order in `throttleFirst`. (<a href='https://github.com/ReactiveX/RxJava/issues/7484'>[#​7484](https://togithub.com/ReactiveX/RxJava/issues/7484)</a>) </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, 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 [Renovate Bot](https://togithub.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzMi4xOTAuNiIsInVwZGF0ZWRJblZlciI6IjMyLjE5MC42In0=-->
Extend
MissingBackpressureException
with a standard message string and a static methods to create the exception with the standard message. This will make sure every case reports the same consistent message.In addition, the queue overflows now have a separate exception class
QueueOverflowException
. This exception should not happen during normal operations and is mainly there to detect misuse or bugs in operators. Consequencly, even though many places used to signalMissingBackpressureException
for such queue overflows, there was no reason to check for this specific exception class outside developing RxJava itself.ThrottleLatest needs to be updated after #7457