Skip to content

Query doesn't complete #292

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
mosherobinov opened this issue Jun 24, 2020 · 11 comments
Closed

Query doesn't complete #292

mosherobinov opened this issue Jun 24, 2020 · 11 comments
Labels
type: bug A general bug type: regression A regression from a previous release
Milestone

Comments

@mosherobinov
Copy link

mosherobinov commented Jun 24, 2020

Bug Report

Versions

  • Driver: 0.8.4.BUILD-SNAPSHOT
  • Database: PostgreSQL 12
  • Java: 1.8.0_202
  • OS: macOS Catalina 10.15.5

Current Behavior

query doesn't complete and doesn't emit all of the rows.

Steps to reproduce

i forked r2dbc-postgresql and added a new test that reproduce this issue.
take a look at this commit: mosherobinov@a679e8e
seems to be some kind of a race between the onNext() and request() when they are happening on different threads,
therefore i had to publish on a different scheduler and limitRate to 1 so the onNext() and request() will interleave.
the test times out after the query doesn't complete.

@x0a1b
Copy link

x0a1b commented Jun 25, 2020

I can confirm this happening; this fix should be part of 0.8.4.RELEASE build.

@mp911de mp911de added type: bug A general bug status: in-progress An issue that is currently being worked on and removed status: waiting-for-triage An issue we've not yet triaged labels Jun 26, 2020
@mp911de mp911de added this to the 0.8.4.RELEASE milestone Jun 26, 2020
@mp911de
Copy link
Collaborator

mp911de commented Jun 26, 2020

Thanks a lot for the reproducer. I'm going to investigate what's going on.

@mp911de
Copy link
Collaborator

mp911de commented Jun 26, 2020

As it looks now, the emission gets stuck after request(1). This is, because of missing upstream demand propagation (hasBufferedItems() && hasDownstreamDemand() doesn't allow entering drainLoop). Calling demandMore() helps to address the issue. Need to check whether that's the fix or whether we might miss something.

mp911de added a commit that referenced this issue Jun 26, 2020
Reorder methods. Add Javadoc.

[#292]
mp911de added a commit that referenced this issue Jun 26, 2020
We now make sure to call demandMore() regardless of the drain loop to ensure that demand is propagated upstream even if the drain conditions are not met. Previously, concurrent consumption lead to an empty buffer without demand propagation and so emission got eventually stuck.

[resolves #292]
mp911de added a commit that referenced this issue Jun 26, 2020
Reorder methods. Add Javadoc.

[#292]
@mp911de mp911de added type: regression A regression from a previous release and removed status: in-progress An issue that is currently being worked on labels Jun 26, 2020
@mp911de
Copy link
Collaborator

mp911de commented Jun 26, 2020

0.8.4 snapshots are available from repo.spring.io. Feel free to test against the new snapshots.

@mosherobinov
Copy link
Author

@mp911de Thanks, i will check it.
do we have a due date for the 0.8.4 release?

@mp911de
Copy link
Collaborator

mp911de commented Jun 26, 2020

Not yet. Roughly, we aimed for shipping releases every two months. Mid-July seems a good target.

@x0a1b
Copy link

x0a1b commented Jun 26, 2020

Is it part of 0.8.4.BUILD-20200626.112115-12? I can deploy it on prod and tell you if I see the issue again.

@x0a1b
Copy link

x0a1b commented Jun 29, 2020

@mp911de I have been trying to pull the SNAPSHOT build I am getting:

12:14:53     > Could not resolve io.r2dbc:r2dbc-postgresql:0.8.4.BUILD-20200626.112115-12.
12:14:53       Required by:
12:14:53           project :
12:14:53        > Could not resolve io.r2dbc:r2dbc-postgresql:0.8.4.BUILD-20200626.112115-12.
12:14:53           > Could not get resource 'https://repo.spring.io/snapshot/io/r2dbc/r2dbc-postgresql/0.8.4.BUILD-SNAPSHOT/r2dbc-postgresql-0.8.4.BUILD-20200626.112115-12.pom'.
12:14:53              > Could not GET 'https://www.jfrog.com/error?from=repo.spring.io&by=nginx-shared3c.gcoss-use1.jfrog.local'. Received status code 403 from server: Forbidden
12:14:53        > Could not resolve io.r2dbc:r2dbc-postgresql:0.8.4.BUILD-20200626.112115-12.
12:14:53           > Could not get resource 'http://repo.spring.io/plugins-release/io/r2dbc/r2dbc-postgresql/0.8.4.BUILD-SNAPSHOT/r2dbc-postgresql-0.8.4.BUILD-20200626.112115-12.pom'.

Gradle seems to be getting 403 here.

@mp911de
Copy link
Collaborator

mp911de commented Jun 30, 2020

repo.spring.io was impacted last night by an incident, see https://status.jfrog.io/incidents/cjx2djy9xzb2 for further details. The incident is resolved now.

@x0a1b
Copy link

x0a1b commented Jun 30, 2020

Thanks it works now.

@mosherobinov
Copy link
Author

i can confirm as well this issue is fixed now.

avinash-anand pushed a commit to avinash-anand/r2dbc-postgresql that referenced this issue Jul 25, 2020
We now make sure to call demandMore() regardless of the drain loop to ensure that demand is propagated upstream even if the drain conditions are not met. Previously, concurrent consumption lead to an empty buffer without demand propagation and so emission got eventually stuck.

[resolves pgjdbc#292]
avinash-anand pushed a commit to avinash-anand/r2dbc-postgresql that referenced this issue Jul 25, 2020
Reorder methods. Add Javadoc.

[pgjdbc#292]
avinash-anand pushed a commit to avinash-anand/r2dbc-postgresql that referenced this issue Jul 25, 2020
We now make sure to call demandMore() regardless of the drain loop to ensure that demand is propagated upstream even if the drain conditions are not met. Previously, concurrent consumption lead to an empty buffer without demand propagation and so emission got eventually stuck.

[resolves pgjdbc#292]
avinash-anand pushed a commit to avinash-anand/r2dbc-postgresql that referenced this issue Jul 25, 2020
Reorder methods. Add Javadoc.

[pgjdbc#292]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug A general bug type: regression A regression from a previous release
Projects
None yet
Development

No branches or pull requests

3 participants