Comments (9)
Maybe also related: Isn't there a way to detect when a connection is lost and to remove these stale connections from the pool? I think that was the case in 0.2.x. At least I did not have to retry the query multiple times in some cases but I MUST do that with 0.3.1
from mysql.
I just recognized: It has nothing to do with the gone server. It also happens if I remove the yield new Delayed()
from mysql.
I believe there is some old TODO with this... Well, looks like we finally have to look into this again properly.
from mysql.
Insight: It happens if not all column-defs are received in the first read. Wasn't able to debug further yet. Gotta go now. Thanks!
from mysql.
I am not sure whats the intention of the read barrier in processor::read but I think that's the cause. ::handlequery resolves the deferred that is added by ::query. If the first read chunk does not contain the whole result, handlequery resolves the deferred but more data is needed. The read loop runs into the read barrier as ::$deferred is empty. But ::$waiting will never be resolved. Actually this can even cause the loop to stop as the read watcher is disabled and no writes are pending.
I also think that's the problem why stale connections aren't detected as the socket is only read when there is a pending ::$deferred. I think that's not quite correct and this was different in 0.2.x which worked well wrt to this issues
from mysql.
Is that read barrier really required? MySQL should only send data when there was a request before anyway, right? And if we have a read without a corresponding Task this should be considered a state or protocol error?!
from mysql.
The purpose of the read barrier was to prevent an idle connection having a busy watcher in the loop, so that the object would be automatically destroyed and the loop stop. The place where the barrier was created and released was wrong however, so the connection was closed prematurely. I believe I fixed the locations, and I also just used the ref/unref API on socket instead of a promise. Please try the current master and let me know if that fixes the issue.
from mysql.
from mysql.
Seems to work, dude :) You made my day! Thanks!
from mysql.
Related Issues (20)
- Implement Support for Protocol::AuthSwitchRequest
- Can we use Named parameters in SQL queries with amphp\mysql package? HOT 1
- Can we have lastInsertId returned in a different method when UUID is used as Primary Key? HOT 4
- Connection closed unexpectedly HOT 4
- Values not saved when named parameters are used in SQL insert queries with amphp\mysql package HOT 3
- about wrapping CommandResult HOT 1
- multi query with prepared statement HOT 5
- Different query result under transaction
- v3 not work HOT 3
- Connection open + one select + close takes about 30 ms HOT 5
- Prepared Statements don't work with DATETIME columns HOT 2
- Reaching connection limit results in protocol version exception HOT 1
- Incorrect handling of fractional seconds in Datetime, and Timestamp columns HOT 3
- Connection closed unexpectedly HOT 2
- Cannot install HOT 5
- Unable to connect to AWS Aurora MySQL 3.04.0 (MySQL 8.0.28) over TLS HOT 5
- Connection closed unexpectedly HOT 4
- Closing database connection while query is still pending HOT 2
- Infinite recursion when iterating HOT 5
- v2: is it possible to set a limit on the max number of parallel connections? HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mysql.