-
-
Notifications
You must be signed in to change notification settings - Fork 9.8k
[Messenger][DoctrineBridge] Throws UnrecoverableMessageHandlingException when passed invalid entity manager name #31482
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
Conversation
|
Well.. it is actually recoverable because if this happens: 1) you see the errors somewhere (Sentry, Bugsnag, etc...), 2) you will fix it and 3) you will redeploy. At no point in this you expect the infrastructure to destroy these messages (which is what it means to have an unrecoverable error). |
|
I've opened this PR because @Tobion suggested make this change in related PR #31334 (comment) . Not sure that developer will have enough time to fix problem and redeploy before messages goes to failed transport after N retries. And there is possibility to retry message from failed transport since Symfony 4.3. But in any case |
|
Recoverable to me means that it is a temporary problem that might fix itself by just retrying. If it's a coding problem auto-retrying does not make sense. If you argue it's recoverable because you can fix it manually, then where is the difference between recoverable and unrecoverable? Everything is recoverable then if you change code... |
weaverryan
left a comment
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.
LGTM
If you have the failure transport configured, the message will immediately (after 1 try) go to the failure transport. Then, in theory, the developer would have time to look at that message, fix the problem, deploy, and retry it.
cd87051 to
d92efc0
Compare
|
Tests are broken and should be fixed before merging (looks like a constraint should be changed in the Doctrine bridge). |
…ty manager name for Doctrine middlewares
d92efc0 to
c4eca27
Compare
|
@fabpot thank you for suggestion, now fixed. |
|
Thank you @Koc. |
…dlingException when passed invalid entity manager name (Koc) This PR was merged into the 4.3 branch. Discussion ---------- [Messenger][DoctrineBridge] Throws UnrecoverableMessageHandlingException when passed invalid entity manager name | Q | A | ------------- | --- | Branch? | 4.3 | Bug fix? | yes | New feature? | no | BC breaks? | not sure | Deprecations? | no | Tests pass? | Waiting for Travis | Fixed tickets | - | License | MIT | Doc PR | - 1. Throws `UnrecoverableMessageHandlingException` and do not retry messages if middlewares missconfigured 2. `getManager()` doesn't return null. Actually [it throws](https://github.com/doctrine/persistence/blob/master/lib/Doctrine/Persistence/AbstractManagerRegistry.php#L144-L160) `\InvalidArgumentException` in requested entity manager not exists. Not sure, should this changes considered as BC-break. Also I can extract abstract Doctrine middleware but not sure what branch should I use for it? Master or 4.3? Commits ------- c4eca27 Throws UnrecoverableMessageHandlingException when passed invalid entity manager name for Doctrine middlewares
UnrecoverableMessageHandlingExceptionand do not retry messages if middlewares missconfiguredgetManager()doesn't return null. Actually it throws\InvalidArgumentExceptionin requested entity manager not exists.Not sure, should this changes considered as BC-break.
Also I can extract abstract Doctrine middleware but not sure what branch should I use for it? Master or 4.3?