Skip to content

On error not triggered when listen connection terminated #212

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
steven-sheehy opened this issue Dec 16, 2019 · 2 comments
Closed

On error not triggered when listen connection terminated #212

steven-sheehy opened this issue Dec 16, 2019 · 2 comments
Labels
type: bug A general bug
Milestone

Comments

@steven-sheehy
Copy link
Contributor

Bug Report

Fails to trigger an onError when the database is stopped and using postgresql listen.

Versions

  • Driver: 0.8.0.RELEASE
  • Database: postgres:11.3-alpine
  • Java: 11
  • OS: MacOS

Current Behavior

Stack trace
// your stack trace here

Table schema

Input Code
-- your SQL here;

Steps to reproduce

Run JUnit test: R2dbcListenApplicationTests.testDisconnect():
https://github.com/steven-sheehy/r2dbc-listen

Input Code
// your code here;

Expected behavior/code

Possible Solution

  • Trigger an onError immediately
  • Attempt reconnect automatically within some timeout, then trigger an onError if unsuccessful

Additional context

@mp911de mp911de added this to the 0.8.1.RELEASE milestone Jan 20, 2020
@mp911de mp911de added the type: bug A general bug label Jan 20, 2020
@mp911de
Copy link
Collaborator

mp911de commented Jan 20, 2020

Probably it would make sense to send different signals when the connection was closed intentionally and unintentionally. If the server goes down, we should send onError. When the application gets shut down, then we would complete the stream normally (onComplete).

mp911de added a commit that referenced this issue Jan 20, 2020
We now terminate the notification stream (PostgresqlConnection.getNotifications()) when the connection gets disconnected. If the connection is closed normally, the stream terminates successfully (onComplete). Unintended disconnects result in an error (onError).

[#212]
@mp911de mp911de added the status: in-progress An issue that is currently being worked on label Jan 21, 2020
gregturn pushed a commit that referenced this issue Jan 27, 2020
We now terminate the notification stream (PostgresqlConnection.getNotifications()) when the connection gets disconnected. If the connection is closed normally, the stream terminates successfully (onComplete). Unintended disconnects result in an error (onError).

[#212]
mp911de added a commit that referenced this issue Jan 28, 2020
We now terminate the notification stream (PostgresqlConnection.getNotifications()) when the connection gets disconnected. If the connection is closed normally, the stream terminates successfully (onComplete). Unintended disconnects result in an error (onError).

[#212]
mp911de added a commit that referenced this issue Jan 28, 2020
mp911de added a commit that referenced this issue Jan 28, 2020
We now terminate the notification stream (PostgresqlConnection.getNotifications()) when the connection gets disconnected. If the connection is closed normally, the stream terminates successfully (onComplete). Unintended disconnects result in an error (onError).

[#212]
@mp911de mp911de removed the status: in-progress An issue that is currently being worked on label Jan 28, 2020
@mp911de
Copy link
Collaborator

mp911de commented Jan 28, 2020

That's fixed now.

@mp911de mp911de closed this as completed Jan 28, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug A general bug
Projects
None yet
Development

No branches or pull requests

2 participants