Skip to content

[Messenger] Incompatibility with DBAL >=3.0 on PostgreSQL transport #42589

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

Closed
ohaag opened this issue Aug 16, 2021 · 8 comments
Closed

[Messenger] Incompatibility with DBAL >=3.0 on PostgreSQL transport #42589

ohaag opened this issue Aug 16, 2021 · 8 comments

Comments

@ohaag
Copy link

ohaag commented Aug 16, 2021

Symfony version(s) affected: 5.3.4

Description

When using the messenger component with symfony/doctrine-messenger on PostgreSQL, if you're not using doctrine/orm, you can update doctrine/dbal to >=3.0. However, for >=3.0, when we run a consumer, the PDO\Connection does not have pgsqlGetNotify method anymore. If I specify doctrine/dbal < 3.0 in my composer, it works well in 2.13.

How to reproduce

Create a project and require symfony/messenger and symfony/doctrine-messenger. You should have dependencies like this (and some other symfony packages)

"require": {
        "php": ">=7.2.5",
        "doctrine/doctrine-bundle": "^2.4",
        "symfony/doctrine-messenger": "5.3.*",
        "symfony/framework-bundle": "5.3.*",
        "symfony/messenger": "5.3.*",
}

and your doctrine/dbal should be >3.0

Setup a message handler using Doctrine Transport. Then if you run the consumer, you will have an error reporting that the pgsqlGetNotify method does not exist.

The line triggering the error: https://github.com/symfony/doctrine-messenger/blob/5.3/Transport/PostgreSqlConnection.php#L75

Additional context

On many projects, the bug will not happen because doctrine/orm (2.9.3 at the moment) or doctrine/migrations, both prevent the upgrade to doctrine/dbal >=3.0.

@burned42
Copy link
Contributor

@ohaag I think this probably got fixed by #43630

@derrabus
Copy link
Member

Yes, it should have. Can you confirm, @ohaag?

@ohaag
Copy link
Author

ohaag commented Oct 24, 2021

I will as soon as I can (probably tommorow).
I'm not sur to understand perfectly the hotfix process. On what version is it available ? Is it live on 5.3.9 stable or should I update on a dev branch ? I don't know how it works as there was no release since the fix has been commited.

@derrabus
Copy link
Member

Is it live on 5.3.9 stable or should I update on a dev branch ?

The fix will be released with 5.3.10 and can already be tested on the 5.3 dev branch.

@ohaag
Copy link
Author

ohaag commented Oct 28, 2021

Yes, I confirm it is fixed.
Reproduced on symfony/doctrine-messenger 5.3.8 and fixed on 5.3.x-dev.
Thank you

@ohaag ohaag closed this as completed Oct 28, 2021
@derrabus
Copy link
Member

Thank you for testing!

@ohaag
Copy link
Author

ohaag commented Oct 28, 2021

While I'm here, what is the easiest way to know what sub-package of symfony/symfony is impacted by a commit ? In this case the issue was related to the messenger component and the doctrine connector so symfony/doctrine-messenger was easy to find, but sometimes it is less obvious on what project a fix is merged.

@stof
Copy link
Member

stof commented Oct 29, 2021

@ohaag look at which part of symfony/symfony is impacted by the diff.
You find the package by going up from that location until you reach a folder containing a composer.json (which is generally the right-most folder being a child of a Component, Contracts, Bridge or Bundle folder, so in the case of #43630, that gives you src/Symfony/Component/Messenger/Bridge/Doctrine as folder, which contains a composer.json saying "name": "symfony/doctrine-messenger"). The only case where this heuristic won't work is for symfony/security-* (where packages are in folders being src/Symfony/Component/Security/* instead)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants