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

Question: Handling DBConnection.ConnectionError #21

Closed
vamsiikrishna opened this issue May 19, 2020 · 1 comment
Closed

Question: Handling DBConnection.ConnectionError #21

vamsiikrishna opened this issue May 19, 2020 · 1 comment

Comments

@vamsiikrishna
Copy link

Hi .
Thanks for creating this module.

I have registered the module under the supervision tree like so :

def start(_type, _args) do
children = [
      {Clickhousex,
       [
         name: Clickhouse,
         scheme: :http,
         hostname: Application.get_env(:app, Clickhouse)[:host],
         port: Application.get_env(:app, Clickhouse)[:port],
         username: Application.get_env(:app, Clickhouse)[:username],
         password: Application.get_env(:app, Clickhouse)[:password],
         database: "bidder_logs"
       ]}
]
 opts = [strategy: :one_for_one, name: App.Supervisor]
 Supervisor.start_link(children, opts)
end

and I am querying like so :

query = "SELECT COUNT(*) from requests"
{:ok, _query, results} = Clickhousex.query(:"Elixir.Clickhouse", query, [])

This was working fine for some time. Due to increased load , I am seeing a lot of these error messages :

{:error,
 %DBConnection.ConnectionError{
   message: "connection not available and request was dropped from queue after 538ms. You can configure how long requests wait in the queue using :queue_target and :queue_interval. See DBConnection.start_link/2 for more information"
 }}

will be really helpful if you can share some resources on how this issue can be handled .

Thanks

@hissssst
Copy link
Contributor

hissssst commented Sep 7, 2020

@vamsiikrishna
This error means that connection has failed. You can implement your own retry logic around this

@hissssst hissssst closed this as completed Sep 7, 2020
@hissssst hissssst changed the title Handling DBConnection.ConnectionError Question: Handling DBConnection.ConnectionError Sep 7, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants