-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
PostgresChannelMessageTableSubscriber not properly handling Database Failover #9061
Comments
I'd also be happy to contribute a PR for this. I would propose to use a configurable timeout for retrieving PGNotifications instead of waiting forever and when the received list is empty to re-new the connection |
PostgresChannelMessageTableSubscriber currently never renews the connection. This causes problems on DB failover. With this change the connection is renewed when notifications are not received for a certain time. fixes spring-projects#9061
PostgresChannelMessageTableSubscriber currently never renews the connection. This causes problems on DB failover. With this change the connection is renewed when notifications are not received for a certain time. fixes spring-projects#9061
PostgresChannelMessageTableSubscriber currently never renews the connection. This causes problems on DB failover. With this change the connection is renewed when notifications are not received for a certain time. fixes spring-projects#9061
P.S. I also think it's a pity that the |
Thank you for looking into this! Will look into your PR shortly. |
PostgresChannelMessageTableSubscriber never renews the connection. This causes problems on DB failover. With this change the connection is renewed when notifications are not received for a certain time. fixes spring-projects#9061
PostgresChannelMessageTableSubscriber never renews the connection. This causes problems on DB failover. With this change the connection is renewed when notifications are not received for a certain time. fixes spring-projects#9061
PostgresChannelMessageTableSubscriber never renews the connection. This causes problems on DB failover. With this change the connection is renewed when notifications are not received for a certain time. fixes spring-projects#9061
PostgresChannelMessageTableSubscriber never renews the connection. This causes problems on DB failover. With this change the connection is renewed when notifications are not received for a certain time. fixes spring-projects#9061
Fixes: #9061 `PostgresChannelMessageTableSubscriber` never renews the connection. This causes problems on DB failover. With this change the connection is renewed when notifications are not received for a certain time. **Auto-cherry-pick to `6.2.x` & `6.1.x`**
Fixes: #9061 `PostgresChannelMessageTableSubscriber` never renews the connection. This causes problems on DB failover. With this change the connection is renewed when notifications are not received for a certain time. (cherry picked from commit 642278d) # Conflicts: # spring-integration-jdbc/src/main/java/org/springframework/integration/jdbc/channel/PostgresChannelMessageTableSubscriber.java # spring-integration-jdbc/src/test/java/org/springframework/integration/jdbc/channel/PostgresChannelMessageTableSubscriberTests.java
…leSubscriber Fixes: spring-projects#9061 `PostgresChannelMessageTableSubscriber` never renews the connection. This causes problems on DB failover. With this change the connection is renewed when notifications are not received for a certain time. **Auto-cherry-pick to `6.2.x` & `6.1.x`**
Fixes: spring-projects#9111 An evolution of the spring-projects#9061: renew the connection only when we need to. **Auto-cherry-pick to `6.2.x` & `6.1.x`**
In what version(s) of Spring Integration are you seeing this issue?
6.x
Describe the bug
When the database is doing a failover the
PostgresChannelMessageTableSubscriber
doesn't notice and will never receive new notifications.For example on AWS RDS instance with multi-AZ standby, when performing a failover the IP address for the DNS does change. But
PostgresChannelMessageTableSubscriber
never re-establishes a connection, nor has some other measurement in place to validate that the connection is still valid.To Reproduce
Perform a DB failover. After this no more messages will be processed.
Expected behavior
Eventually the
PostgresChannelMessageTableSubscriber
obtains a new connection after failover, and message processing will work again.Sample
Sorry, not being able to provide a complete sample, as this involves infrastructure 🤷♂️
The text was updated successfully, but these errors were encountered: