-
Notifications
You must be signed in to change notification settings - Fork 17
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
connectPool
never returns second time
#47
Comments
Yes, I spent the whole day finding the issue I had with my code (I had two connectPool too). The problem is in lines rethinkdb-ts/src/query-builder/r.ts Lines 51 to 54 in 12fa163
There an existing pool on the same connection will be drained if a new pool is created on the same connection. That can lead to silent errors in my opinion. At least it is necessary to await the pool finishing the draining in line rethinkdb-ts/src/query-builder/r.ts Line 53 in 12fa163
rethinkdb-ts/src/query-builder/r.ts Line 59 in 12fa163
Maybe it is better to throw an error that a pool has to be closed manually before creating a new one instead of silently creating a new pool to avoid clumsy errors. On the other hand MasterPool can handle an array of serverPools (see
rethinkdb-ts/src/query-builder/r.ts Lines 55 to 59 in 12fa163
|
@GaikwadPratik @anli-xsigns I might resolve this by splitting the logic into separate models, so |
At the moment I'm not using this anymore. Your idea sounds good. |
@anli-xsigns you are not using rethinkdb or this exact library? |
I'm not using rethinkdb anymore because work seems to be suspended again. |
Can't say thats a bad decision=) |
@ronzeidman ,
This is more like a question than an issue. If I invoke
await r.connectPool(dbOptions);
multiple times(mistakenly), then only the first call returns, the second call or any subsequent calls to the above line never returns and kind of appear to be freezing.Any idea, why?
The text was updated successfully, but these errors were encountered: