Skip to content

Using package with celery #544

Description

@arjunChouksey

Hey currenlty im using this package in celery task, My tasks fails due to one of the two reasons

  1. raised unexpected: PoolTimeout("couldn't get a connection after 30.0 sec") (when i use query that writes (INSERT) in database)
  2. psycopg_pool.PoolTimeout: couldn't get a connection after 30.0 sec. (when i use query that reads(SELECT) in database)

what could be the possible problem here ? Can somebody tell me.

Thanks in advance

[2023-04-06 18:55:35,696: ERROR/ForkPoolWorker-1] Task COLLECT_DATA_ONCE[2c9f89ee-27a4-48b3-b5b7-244766b2c660] raised unexpected: PoolTimeout("couldn't get a connection after 30.0 sec")
Traceback (most recent call last):
  File "/opt/venv/lib/python3.8/site-packages/celery/app/trace.py", line 451, in trace_task
    R = retval = fun(*args, **kwargs)
  File "/opt/venv/lib/python3.8/site-packages/sentry_sdk/integrations/celery.py", line 207, in _inner
    reraise(*exc_info)
  File "/opt/venv/lib/python3.8/site-packages/sentry_sdk/_compat.py", line 60, in reraise
    raise value
  File "/opt/venv/lib/python3.8/site-packages/sentry_sdk/integrations/celery.py", line 202, in _inner
    return f(*args, **kwargs)
  File "/opt/venv/lib/python3.8/site-packages/celery/app/trace.py", line 734, in __protected_call__
    return self.run(*args, **kwargs)
  File "/apps/celery/tasks.py", line 576, in collect_data
    (HistoricalDataCollection()).collect_once_fo()
  File "/apps/scripts/historical.py", line 292, in collect_once_fo
    self.timescale.write(delete_fno_tick_query)
  File "/apps/factory/databases/timescale.py", line 50, in write
    with self._pool.connection() as _connection:
  File "/usr/local/lib/python3.8/contextlib.py", line 113, in __enter__
    return next(self.gen)
  File "/opt/venv/lib/python3.8/site-packages/psycopg_pool/pool.py", line 138, in connection
    conn = self.getconn(timeout=timeout)
  File "/opt/venv/lib/python3.8/site-packages/psycopg_pool/pool.py", line 182, in getconn
    conn = pos.wait(timeout=timeout)
  File "/opt/venv/lib/python3.8/site-packages/psycopg_pool/pool.py", line 745, in wait
    raise self.error
psycopg_pool.PoolTimeout: couldn't get a connection after 30.0 sec

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions