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

Prom async bug #9

Closed
Jaymon opened this issue May 23, 2015 · 1 comment
Closed

Prom async bug #9

Jaymon opened this issue May 23, 2015 · 1 comment

Comments

@Jaymon
Copy link
Owner

Jaymon commented May 23, 2015

On one of our tests, the foo/bar script uses greenthreads, and when they both start up without a wait between them they will cause a connection pool error

c1 = ScriptClient("foo/bar")
r1 = c1.run_async()

c2 = ScriptClient("foo/bar")
r2 = c2.run_async()

c1.wait()
c2.wait()

The error:

'NoneType' object has no attribute 'getconn'
Traceback (most recent call last):
  ...
  File "/usr/local/lib/python2.7/dist-packages/prom/query.py", line 573, in get_one
    d = self._query('get_one')
  File "/usr/local/lib/python2.7/dist-packages/prom/query.py", line 682, in _query
    return getattr(i, method_name)(s, self) # i.method_name(schema, query)
  File "/usr/local/lib/python2.7/dist-packages/prom/interface/base.py", line 485, in get_one
    ret = self._get_query(self._get_one, schema, query, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/prom/decorators.py", line 58, in wrapper
    return func(self, *args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/prom/interface/base.py", line 453, in _get_query
    with self.connection(**kwargs) as connection:
  File "/usr/lib/python2.7/contextlib.py", line 17, in __enter__
    return self.gen.next()
  File "/usr/local/lib/python2.7/dist-packages/prom/interface/base.py", line 177, in connection
    self.raise_error(e)
  File "/usr/local/lib/python2.7/dist-packages/prom/interface/base.py", line 167, in connection
    connection = self.get_connection()
  File "/usr/local/lib/python2.7/dist-packages/prom/interface/postgres.py", line 98, in get_connection
    connection = self.connection_pool.getconn()
AttributeError: 'NoneType' object has no attribute 'getconn'

This only shows up in tests, I think the reason why is because we've cleared all the tables and so the prom error handling table creation code kicks on the first connection and then the second connection causes a problem?

@Jaymon
Copy link
Owner Author

Jaymon commented Oct 16, 2021

This can be closed when #138 is implemented

Jaymon added a commit that referenced this issue Jan 13, 2024
@Jaymon Jaymon closed this as completed Jan 13, 2024
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

1 participant