Skip to content
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

The connection was closed before the query could be completed in #113

Open
ptorrent opened this issue Jan 25, 2023 · 5 comments
Open

The connection was closed before the query could be completed in #113

ptorrent opened this issue Jan 25, 2023 · 5 comments
Labels
bug Something isn't working

Comments

@ptorrent
Copy link

ptorrent commented Jan 25, 2023

Hello,

Working fine but after a while I've got "The connection was closed before the query could be completed in" in every request. The only way i've to make it work is to restart the process...

conn = r.connectPool({
	silent	: true,
	waitForHealthy: true,
	servers	:  [{ host : 'server1', port :...},{host : 'server2', port : ...],
	buffer	: 300,
        max		: 3000
});

System info

  • Debien Bullseye
  • RethinkDB Version: 2.42

Additional context
1x cluster of 2 servers

Is there a link with the connectPool ? Any idea ?

@ptorrent ptorrent added the bug Something isn't working label Jan 25, 2023
@atassis
Copy link
Collaborator

atassis commented Jan 26, 2023

connection pool seems to be buggy. can't reproduce the bug and have no time and resources to do smth with that. We have fixed that with creating a proxy server of a rethinkdb, to which the client connects (proxy handles the pooling of connections)

@ptorrent
Copy link
Author

ptorrent commented Jan 26, 2023

if I can help in any way please say. I can give you access to the server with this problem. The problem is really happening every 30 minutes. It's regular.

I'm logging 'queueing' 'size' 'available-size' in my script. And this is what I see. After a while there is no more event on

"available-size" and "size"

Looks like it's stuck

pool size 654
pool available-size 648
pool queueing 12

pool queueing 12 is the number of changes() listeners. Seems correct.

This is my pool configuration:

buffer		: 300,
max			: 1000

@ptorrent
Copy link
Author

ptorrent commented Jan 26, 2023

And this is the log just before it crashs

I received the events "available-size" and "size" when I had not received it for a while

pool queueing 12
pool size 657
pool available-size 652
public table feedChange error FeedChange #0 from event The connection was closed before the query could be completed in:

By the way, I never receive the "error" event on the pool. This error came from here:


this.r.db(this.db).table(this.table, {readMode: 'outdated'}).changes({
	includeTypes :true
}).run().then(function(cursor){
	cursor.each(function(e, item){
		if(e){
                    =====> e
               }
       })
 

})

After that, nothing to do. Just restart the process.

@atassis
Copy link
Collaborator

atassis commented Jan 26, 2023

I am not quite sure how to fix that but to start rewriting the whole codebase with keeping some of the logic already done. My suggestion is some things are done wrong in rethinkdbdash from which this project has started, which keeps other stuff being buggy. And because for now other things are working well for my company- I don't spend a time on it. You might wanna try the 3.x alpha version of this library, though mostly I have just fixed some coupling problems from modules perspective

@ptorrent
Copy link
Author

ptorrent commented Jan 26, 2023

I think it's an issue with buffer and max

I put back rethinkdbdash and available-size looks more correct:

rethinkdbdash:

available-size 305

(I don't have "size" event on rethinkddash", don't know why...)

rethinkdb-ts:

pool size 657
pool available-size 652

Both of them with those options:

buffer: 300 - Minimum number of connections available in the pool, default 50
max: 1000 - Maximum number of connections available in the pool, default 1000

With rethinkdb-ts apparently it opens 2x more connections ?

Connections pool looks more stable on rethinkdbdash

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants