-
Notifications
You must be signed in to change notification settings - Fork 30
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
Exceptions in emq_auth_pgsql plugin #84
Comments
I am seeing this as well on 2.3.5. |
it looks like it is using a pool with ecpool. I wonder if the issue is 10 connections being used many processes. |
My hunch is that the issue is with bad concurrency handling in ecpool. Looks like an ecpool bug that is apparent only under moderate to high load. |
The source of the issue is here: https://github.com/emqtt/ecpool/blob/master/src/ecpool_pool.erl#L62 ecpool picks a random client from the pool, instead of claiming it. This can result in the same db connection concurrently being used for more than one query, resulting in the error. |
Is there any fix? |
Yes, it has been fixed in emqx3.0 rc.3 |
I am facing this issue with emqx v4.0.0, with postgres server in front of pgbouncer |
pgbouncer is configured in Transaction Mode. |
|
It works fine without pgbouncer. |
Posted fresh issue #197 for pgBouncer problem. |
I am still experiencing this with emqx 4.2.2 inside of a docker swarm. Both emqx and postgresql are running on the same node. |
Hi,
while testing our EMQ deployment in production i discovered that
emq_auth_pgsql
plugin throws errors when connecting to the broker "from time to time". That is, sometimes the sql query cannot be executed correctly i guess.Sometimes i get
2018-03-27 13:00:24.849 [error] <0.1909.0>@emqttd_protocol:process:234 Client([email protected]:63100): Username '0Tz9s' login failed for {error,error,<<"26000">>,invalid_sql_statement_name,<<"unnamed prepared statement does not exist">>,[{file,<<"postgres.c">>},{line,<<"1487">>},{routine,<<"exec_bind_message">>},{severity,<<"ERROR">>}]}
Other times the client can connect without any problem.
Sometimes i get:
2018-03-27 13:01:19.101 [error] <0.1959.0>@emqttd_protocol:process:287 Client([email protected]:63171): Cannot SUBSCRIBE [{<<"1.1/R/5FxrX">>,[{qos,0}]}] for ACL Deny
other times it works. Probably a problem regarding
epgsql
? Probably related to epgsql/epgsql#150The text was updated successfully, but these errors were encountered: