-
Notifications
You must be signed in to change notification settings - Fork 87
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
Crash in parsing state on {$2, <<>>} message #25
Comments
Perhaps this is related. I've been getting the following error as well:
So I added parsing/3 to pgsql_connection, and this is what it logged for the 3 arguments:
I am also using epgsql_pool. Incidentally, I wasn't getting timeout on individual queries, but when trying over a list comprehension of 10,100, I was able to reproduce the timeout ( on all nodes ). My solution was to return_connection everytime i get_connection. Do you have any easily foreseen reasons why querying will timeout ? Update: This issue could be similiar to zotonic/zotonic#23 where they diagnosed this as
~B |
Hi, sorry for the delayed response! @tsloughter are you able to reproduce your problem? A minimal test case would be a huge help in diagnosing the issue. The reason it stays in the parsing state is because it sends a sync command and waits for the response before sending a reply to the client. @bosky101 your issue doesn't look related to timeouts? It does look similar to zotonic's issue which was multiple processes attempting to use a single connection, which won't work. |
@wg Appreciate you taking time to respond. Yes, the zotonic issue helped. I was spawning a process before run_equery. So when i changed this to something less asynchronous, my error was resolved. Here are some additional stats I logged for testing N writes with various connection handling techniques...
@wg Some Quick questions, if you don't mind...
~B |
@bosky101 if a connection is stored in a process's state then I wouldn't think any other process would have access to it. They definitely would have to handle connection loss though. I don't write much erlang anymore, but my preference was for creating pools of data accessor processes, each owning a connection. This seemed more in the spirit of erlang's concurrency model vs a connection pool. |
I ran into a crash today where the pgsql_connection is in the parsing state, and from the sasl logs I see that reply={error, timeout} in the state record. It crashes because it receives the message {$2, <<>>} and that is not a valid message while in the parsing state.
I found it interesting that when parsing times out it continues on in the parsing state:
Why does it not go to the timeout state like querying?
The text was updated successfully, but these errors were encountered: