pypy teardown failures

Issue #3407 resolved
Michael Bayer
repo owner created an issue

these may all be from test_baked not cleaning up connections

_ ERROR at teardown of ResultTest_postgresql_psycopg2cffi.test_w_new_entities __
[gw0] linux2 -- Python 2.7.8 /var/jenkins/workspace/sqlalchemy-default-sqlite-pypy-2.7/.tox/full/bin/python
Traceback (most recent call last):
  File "/var/jenkins/workspace/sqlalchemy-default-sqlite-pypy-2.7/.tox/full/site-packages/sqlalchemy/testing/fixtures.py", line 273, in teardown_class
    cls._teardown_once_metadata_bind()
  File "/var/jenkins/workspace/sqlalchemy-default-sqlite-pypy-2.7/.tox/full/site-packages/sqlalchemy/testing/fixtures.py", line 155, in _teardown_once_metadata_bind
    drop_all_tables(cls.metadata, cls.bind)
  File "/var/jenkins/workspace/sqlalchemy-default-sqlite-pypy-2.7/.tox/full/site-packages/sqlalchemy/testing/engines.py", line 108, in drop_all_tables
    metadata.drop_all(bind)
  File "/var/jenkins/workspace/sqlalchemy-default-sqlite-pypy-2.7/.tox/full/site-packages/sqlalchemy/sql/schema.py", line 3641, in drop_all
    tables=tables)
  File "/var/jenkins/workspace/sqlalchemy-default-sqlite-pypy-2.7/.tox/full/site-packages/sqlalchemy/engine/base.py", line 1850, in _run_visitor
    with self._optional_conn_ctx_manager(connection) as conn:
  File "/opt/pypy-python2.7/lib-python/2.7/contextlib.py", line 17, in __enter__
    return self.gen.next()
  File "/var/jenkins/workspace/sqlalchemy-default-sqlite-pypy-2.7/.tox/full/site-packages/sqlalchemy/engine/base.py", line 1843, in _optional_conn_ctx_manager
    with self.contextual_connect() as conn:
  File "/var/jenkins/workspace/sqlalchemy-default-sqlite-pypy-2.7/.tox/full/site-packages/sqlalchemy/engine/base.py", line 2034, in contextual_connect
    self._wrap_pool_connect(self.pool.connect, None),
  File "/var/jenkins/workspace/sqlalchemy-default-sqlite-pypy-2.7/.tox/full/site-packages/sqlalchemy/engine/base.py", line 2069, in _wrap_pool_connect
    return fn()
  File "/var/jenkins/workspace/sqlalchemy-default-sqlite-pypy-2.7/.tox/full/site-packages/sqlalchemy/pool.py", line 376, in connect
    return _ConnectionFairy._checkout(self)
  File "/var/jenkins/workspace/sqlalchemy-default-sqlite-pypy-2.7/.tox/full/site-packages/sqlalchemy/pool.py", line 708, in _checkout
    fairy = _ConnectionRecord.checkout(pool)
  File "/var/jenkins/workspace/sqlalchemy-default-sqlite-pypy-2.7/.tox/full/site-packages/sqlalchemy/pool.py", line 480, in checkout
    rec = pool._do_get()
  File "/var/jenkins/workspace/sqlalchemy-default-sqlite-pypy-2.7/.tox/full/site-packages/sqlalchemy/pool.py", line 1042, in _do_get
    (self.size(), self.overflow(), self._timeout))
TimeoutError: QueuePool limit of size 5 overflow 0 reached, connection timed out, timeout 0
--------------------------- Captured stdout teardown ---------------------------
2015-05-01 01:44:56,618 ERROR sqlalchemy.pool.QueuePool Exception during reset or similar
Traceback (most recent call last):
  File "/var/jenkins/workspace/sqlalchemy-default-sqlite-pypy-2.7/.tox/full/site-packages/sqlalchemy/pool.py", line 631, in _finalize_fairy
    fairy._reset(pool)
  File "/var/jenkins/workspace/sqlalchemy-default-sqlite-pypy-2.7/.tox/full/site-packages/sqlalchemy/pool.py", line 765, in _reset
    pool._dialect.do_rollback(self)
  File "/var/jenkins/workspace/sqlalchemy-default-sqlite-pypy-2.7/.tox/full/site-packages/sqlalchemy/engine/default.py", line 412, in do_rollback
    dbapi_connection.rollback()
  File "/opt/pypy-python2.7/site-packages/psycopg2cffi/_impl/connection.py", line 42, in check_closed_
    raise exceptions.InterfaceError('connection already closed')
InterfaceError: connection already closed
2015-05-01 01:44:56,619 ERROR sqlalchemy.pool.QueuePool Exception during reset or similar
Traceback (most recent call last):
  File "/var/jenkins/workspace/sqlalchemy-default-sqlite-pypy-2.7/.tox/full/site-packages/sqlalchemy/pool.py", line 631, in _finalize_fairy
    fairy._reset(pool)
  File "/var/jenkins/workspace/sqlalchemy-default-sqlite-pypy-2.7/.tox/full/site-packages/sqlalchemy/pool.py", line 765, in _reset
    pool._dialect.do_rollback(self)
  File "/var/jenkins/workspace/sqlalchemy-default-sqlite-pypy-2.7/.tox/full/site-packages/sqlalchemy/engine/default.py", line 412, in do_rollback
    dbapi_connection.rollback()
  File "/opt/pypy-python2.7/site-packages/psycopg2cffi/_impl/connection.py", line 42, in check_closed_
    raise exceptions.InterfaceError('connection already closed')
InterfaceError: connection already closed
2015-05-01 01:44:56,620 ERROR sqlalchemy.pool.QueuePool Exception during reset or similar
Traceback (most recent call last):
  File "/var/jenkins/workspace/sqlalchemy-default-sqlite-pypy-2.7/.tox/full/site-packages/sqlalchemy/pool.py", line 631, in _finalize_fairy
    fairy._reset(pool)
  File "/var/jenkins/workspace/sqlalchemy-default-sqlite-pypy-2.7/.tox/full/site-packages/sqlalchemy/pool.py", line 765, in _reset
    pool._dialect.do_rollback(self)
  File "/var/jenkins/workspace/sqlalchemy-default-sqlite-pypy-2.7/.tox/full/site-packages/sqlalchemy/engine/default.py", line 412, in do_rollback
    dbapi_connection.rollback()
  File "/opt/pypy-python2.7/site-packages/psycopg2cffi/_impl/connection.py", line 42, in check_closed_
    raise exceptions.InterfaceError('connection already closed')
InterfaceError: connection already closed
2015-05-01 01:44:56,621 ERROR sqlalchemy.pool.QueuePool Exception during reset or similar
Traceback (most recent call last):
  File "/var/jenkins/workspace/sqlalchemy-default-sqlite-pypy-2.7/.tox/full/site-packages/sqlalchemy/pool.py", line 631, in _finalize_fairy
    fairy._reset(pool)
  File "/var/jenkins/workspace/sqlalchemy-default-sqlite-pypy-2.7/.tox/full/site-packages/sqlalchemy/pool.py", line 765, in _reset
    pool._dialect.do_rollback(self)
  File "/var/jenkins/workspace/sqlalchemy-default-sqlite-pypy-2.7/.tox/full/site-packages/sqlalchemy/engine/default.py", line 412, in do_rollback
    dbapi_connection.rollback()
  File "/opt/pypy-python2.7/site-packages/psycopg2cffi/_impl/connection.py", line 42, in check_closed_
    raise exceptions.InterfaceError('connection already closed')
InterfaceError: connection already closed
2015-05-01 01:44:56,621 ERROR sqlalchemy.pool.QueuePool Exception during reset or similar
Traceback (most recent call last):
  File "/var/jenkins/workspace/sqlalchemy-default-sqlite-pypy-2.7/.tox/full/site-packages/sqlalchemy/pool.py", line 631, in _finalize_fairy
    fairy._reset(pool)
  File "/var/jenkins/workspace/sqlalchemy-default-sqlite-pypy-2.7/.tox/full/site-packages/sqlalchemy/pool.py", line 765, in _reset
    pool._dialect.do_rollback(self)
  File "/var/jenkins/workspace/sqlalchemy-default-sqlite-pypy-2.7/.tox/full/site-packages/sqlalchemy/engine/default.py", line 412, in do_rollback
    dbapi_connection.rollback()
  File "/opt/pypy-python2.7/site-packages/psycopg2cffi/_impl/connection.py", line 42, in check_closed_
    raise exceptions.InterfaceError('connection already closed')
InterfaceError: connection already closed
=================================== FAILURES ===================================
________ ResultTest_postgresql_psycopg2cffi.test_spoiled_half_w_params _________
[gw0] linux2 -- Python 2.7.8 /var/jenkins/workspace/sqlalchemy-default-sqlite-pypy-2.7/.tox/full/bin/python
Traceback (most recent call last):
  File "/var/jenkins/workspace/sqlalchemy-default-sqlite-pypy-2.7/test/ext/test_baked.py", line 341, in test_spoiled_half_w_params
    bq.spoil().add_criteria(fn3)(sess).params(id=7).all(),
  File "/var/jenkins/workspace/sqlalchemy-default-sqlite-pypy-2.7/.tox/full/site-packages/sqlalchemy/ext/baked.py", line 295, in all
    return list(self)
  File "/var/jenkins/workspace/sqlalchemy-default-sqlite-pypy-2.7/.tox/full/site-packages/sqlalchemy/ext/baked.py", line 241, in __iter__
    return iter(self._as_query())
  File "/var/jenkins/workspace/sqlalchemy-default-sqlite-pypy-2.7/.tox/full/site-packages/sqlalchemy/orm/query.py", line 2515, in __iter__
    return self._execute_and_instances(context)
  File "/var/jenkins/workspace/sqlalchemy-default-sqlite-pypy-2.7/.tox/full/site-packages/sqlalchemy/orm/query.py", line 2528, in _execute_and_instances
    close_with_result=True)
  File "/var/jenkins/workspace/sqlalchemy-default-sqlite-pypy-2.7/.tox/full/site-packages/sqlalchemy/orm/query.py", line 2519, in _connection_from_session
    **kw)
  File "/var/jenkins/workspace/sqlalchemy-default-sqlite-pypy-2.7/.tox/full/site-packages/sqlalchemy/orm/session.py", line 882, in connection
    execution_options=execution_options)
  File "/var/jenkins/workspace/sqlalchemy-default-sqlite-pypy-2.7/.tox/full/site-packages/sqlalchemy/orm/session.py", line 887, in _connection_for_bind
    engine, execution_options)
  File "/var/jenkins/workspace/sqlalchemy-default-sqlite-pypy-2.7/.tox/full/site-packages/sqlalchemy/orm/session.py", line 334, in _connection_for_bind
    conn = bind.contextual_connect()
  File "/var/jenkins/workspace/sqlalchemy-default-sqlite-pypy-2.7/.tox/full/site-packages/sqlalchemy/engine/base.py", line 2034, in contextual_connect
    self._wrap_pool_connect(self.pool.connect, None),
  File "/var/jenkins/workspace/sqlalchemy-default-sqlite-pypy-2.7/.tox/full/site-packages/sqlalchemy/engine/base.py", line 2069, in _wrap_pool_connect
    return fn()
  File "/var/jenkins/workspace/sqlalchemy-default-sqlite-pypy-2.7/.tox/full/site-packages/sqlalchemy/pool.py", line 376, in connect
    return _ConnectionFairy._checkout(self)
  File "/var/jenkins/workspace/sqlalchemy-default-sqlite-pypy-2.7/.tox/full/site-packages/sqlalchemy/pool.py", line 708, in _checkout
    fairy = _ConnectionRecord.checkout(pool)
  File "/var/jenkins/workspace/sqlalchemy-default-sqlite-pypy-2.7/.tox/full/site-packages/sqlalchemy/pool.py", line 480, in checkout
    rec = pool._do_get()
  File "/var/jenkins/workspace/sqlalchemy-default-sqlite-pypy-2.7/.tox/full/site-packages/sqlalchemy/pool.py", line 1042, in _do_get
    (self.size(), self.overflow(), self._timeout))
TimeoutError: QueuePool limit of size 5 overflow 0 reached, connection timed out, timeout 0
________ ResultTest_postgresql_psycopg2cffi.test_subquery_eagerloading _________
[gw0] linux2 -- Python 2.7.8 /var/jenkins/workspace/sqlalchemy-default-sqlite-pypy-2.7/.tox/full/bin/python
Traceback (most recent call last):
  File "/var/jenkins/workspace/sqlalchemy-default-sqlite-pypy-2.7/test/ext/test_baked.py", line 527, in test_subquery_eagerloading
    self.assert_sql_count(testing.db, go, 2)
  File "/var/jenkins/workspace/sqlalchemy-default-sqlite-pypy-2.7/.tox/full/site-packages/sqlalchemy/testing/assertions.py", line 466, in assert_sql_count
    db, callable_, assertsql.CountStatements(count))
  File "/var/jenkins/workspace/sqlalchemy-default-sqlite-pypy-2.7/.tox/full/site-packages/sqlalchemy/testing/assertions.py", line 447, in assert_sql_execution
    callable_()
  File "/var/jenkins/workspace/sqlalchemy-default-sqlite-pypy-2.7/test/ext/test_baked.py", line 525, in go
    result = bq(sess).all()
  File "/var/jenkins/workspace/sqlalchemy-default-sqlite-pypy-2.7/.tox/full/site-packages/sqlalchemy/ext/baked.py", line 295, in all
    return list(self)
  File "/var/jenkins/workspace/sqlalchemy-default-sqlite-pypy-2.7/.tox/full/site-packages/sqlalchemy/ext/baked.py", line 257, in __iter__
    with_session(self.session)._execute_and_instances(context)
  File "/var/jenkins/workspace/sqlalchemy-default-sqlite-pypy-2.7/.tox/full/site-packages/sqlalchemy/orm/query.py", line 2528, in _execute_and_instances
    close_with_result=True)
  File "/var/jenkins/workspace/sqlalchemy-default-sqlite-pypy-2.7/.tox/full/site-packages/sqlalchemy/orm/query.py", line 2519, in _connection_from_session
    **kw)
  File "/var/jenkins/workspace/sqlalchemy-default-sqlite-pypy-2.7/.tox/full/site-packages/sqlalchemy/orm/session.py", line 882, in connection
    execution_options=execution_options)
  File "/var/jenkins/workspace/sqlalchemy-default-sqlite-pypy-2.7/.tox/full/site-packages/sqlalchemy/orm/session.py", line 887, in _connection_for_bind
    engine, execution_options)
  File "/var/jenkins/workspace/sqlalchemy-default-sqlite-pypy-2.7/.tox/full/site-packages/sqlalchemy/orm/session.py", line 334, in _connection_for_bind
    conn = bind.contextual_connect()
  File "/var/jenkins/workspace/sqlalchemy-default-sqlite-pypy-2.7/.tox/full/site-packages/sqlalchemy/engine/base.py", line 2034, in contextual_connect
    self._wrap_pool_connect(self.pool.connect, None),
  File "/var/jenkins/workspace/sqlalchemy-default-sqlite-pypy-2.7/.tox/full/site-packages/sqlalchemy/engine/base.py", line 2069, in _wrap_pool_connect
    return fn()
  File "/var/jenkins/workspace/sqlalchemy-default-sqlite-pypy-2.7/.tox/full/site-packages/sqlalchemy/pool.py", line 376, in connect
    return _ConnectionFairy._checkout(self)
  File "/var/jenkins/workspace/sqlalchemy-default-sqlite-pypy-2.7/.tox/full/site-packages/sqlalchemy/pool.py", line 708, in _checkout
    fairy = _ConnectionRecord.checkout(pool)
  File "/var/jenkins/workspace/sqlalchemy-default-sqlite-pypy-2.7/.tox/full/site-packages/sqlalchemy/pool.py", line 480, in checkout
    rec = pool._do_get()
  File "/var/jenkins/workspace/sqlalchemy-default-sqlite-pypy-2.7/.tox/full/site-packages/sqlalchemy/pool.py", line 1042, in _do_get
    (self.size(), self.overflow(), self._timeout))
TimeoutError: QueuePool limit of size 5 overflow 0 reached, connection timed out, timeout 0
____________ ResultTest_postgresql_psycopg2cffi.test_w_new_entities ____________
[gw0] linux2 -- Python 2.7.8 /var/jenkins/workspace/sqlalchemy-default-sqlite-pypy-2.7/.tox/full/bin/python
Traceback (most recent call last):
  File "/var/jenkins/workspace/sqlalchemy-default-sqlite-pypy-2.7/test/ext/test_baked.py", line 368, in test_w_new_entities
    bq(session).all(),
  File "/var/jenkins/workspace/sqlalchemy-default-sqlite-pypy-2.7/.tox/full/site-packages/sqlalchemy/ext/baked.py", line 295, in all
    return list(self)
  File "/var/jenkins/workspace/sqlalchemy-default-sqlite-pypy-2.7/.tox/full/site-packages/sqlalchemy/ext/baked.py", line 257, in __iter__
    with_session(self.session)._execute_and_instances(context)
  File "/var/jenkins/workspace/sqlalchemy-default-sqlite-pypy-2.7/.tox/full/site-packages/sqlalchemy/orm/query.py", line 2528, in _execute_and_instances
    close_with_result=True)
  File "/var/jenkins/workspace/sqlalchemy-default-sqlite-pypy-2.7/.tox/full/site-packages/sqlalchemy/orm/query.py", line 2519, in _connection_from_session
    **kw)
  File "/var/jenkins/workspace/sqlalchemy-default-sqlite-pypy-2.7/.tox/full/site-packages/sqlalchemy/orm/session.py", line 882, in connection
    execution_options=execution_options)
  File "/var/jenkins/workspace/sqlalchemy-default-sqlite-pypy-2.7/.tox/full/site-packages/sqlalchemy/orm/session.py", line 887, in _connection_for_bind
    engine, execution_options)
  File "/var/jenkins/workspace/sqlalchemy-default-sqlite-pypy-2.7/.tox/full/site-packages/sqlalchemy/orm/session.py", line 334, in _connection_for_bind
    conn = bind.contextual_connect()
  File "/var/jenkins/workspace/sqlalchemy-default-sqlite-pypy-2.7/.tox/full/site-packages/sqlalchemy/engine/base.py", line 2034, in contextual_connect
    self._wrap_pool_connect(self.pool.connect, None),
  File "/var/jenkins/workspace/sqlalchemy-default-sqlite-pypy-2.7/.tox/full/site-packages/sqlalchemy/engine/base.py", line 2069, in _wrap_pool_connect
    return fn()
  File "/var/jenkins/workspace/sqlalchemy-default-sqlite-pypy-2.7/.tox/full/site-packages/sqlalchemy/pool.py", line 376, in connect
    return _ConnectionFairy._checkout(self)
  File "/var/jenkins/workspace/sqlalchemy-default-sqlite-pypy-2.7/.tox/full/site-packages/sqlalchemy/pool.py", line 708, in _checkout
    fairy = _ConnectionRecord.checkout(pool)
  File "/var/jenkins/workspace/sqlalchemy-default-sqlite-pypy-2.7/.tox/full/site-packages/sqlalchemy/pool.py", line 480, in checkout
    rec = pool._do_get()
  File "/var/jenkins/workspace/sqlalchemy-default-sqlite-pypy-2.7/.tox/full/site-packages/sqlalchemy/pool.py", line 1042, in _do_get
    (self.size(), self.overflow(), self._timeout))
TimeoutError: QueuePool limit of size 5 overflow 0 reached, connection timed out, timeout 0
_________ ExecutionTest_postgresql_psycopg2cffi.test_parameter_execute _________
[gw0] linux2 -- Python 2.7.8 /var/jenkins/workspace/sqlalchemy-default-sqlite-pypy-2.7/.tox/full/bin/python
Traceback (most recent call last):
  File "/var/jenkins/workspace/sqlalchemy-default-sqlite-pypy-2.7/test/orm/test_session.py", line 61, in test_parameter_execute
    {"id": 8, "name": "u8"}
  File "/var/jenkins/workspace/sqlalchemy-default-sqlite-pypy-2.7/.tox/full/site-packages/sqlalchemy/orm/session.py", line 1023, in execute
    bind, close_with_result=True).execute(clause, params or {})
  File "/var/jenkins/workspace/sqlalchemy-default-sqlite-pypy-2.7/.tox/full/site-packages/sqlalchemy/engine/base.py", line 914, in execute
    return meth(self, multiparams, params)
  File "/var/jenkins/workspace/sqlalchemy-default-sqlite-pypy-2.7/.tox/full/site-packages/sqlalchemy/sql/elements.py", line 323, in _execute_on_connection
    return connection._execute_clauseelement(self, multiparams, params)
  File "/var/jenkins/workspace/sqlalchemy-default-sqlite-pypy-2.7/.tox/full/site-packages/sqlalchemy/engine/base.py", line 1010, in _execute_clauseelement
    compiled_sql, distilled_params
  File "/var/jenkins/workspace/sqlalchemy-default-sqlite-pypy-2.7/.tox/full/site-packages/sqlalchemy/engine/base.py", line 1146, in _execute_context
    context)
  File "/var/jenkins/workspace/sqlalchemy-default-sqlite-pypy-2.7/.tox/full/site-packages/sqlalchemy/engine/base.py", line 1339, in _handle_dbapi_exception
    exc_info
  File "/var/jenkins/workspace/sqlalchemy-default-sqlite-pypy-2.7/.tox/full/site-packages/sqlalchemy/util/compat.py", line 199, in raise_from_cause
    reraise(type(exception), exception, tb=exc_tb)
  File "/var/jenkins/workspace/sqlalchemy-default-sqlite-pypy-2.7/.tox/full/site-packages/sqlalchemy/engine/base.py", line 1116, in _execute_context
    context)
  File "/var/jenkins/workspace/sqlalchemy-default-sqlite-pypy-2.7/.tox/full/site-packages/sqlalchemy/engine/default.py", line 439, in do_executemany
    cursor.executemany(statement, parameters)
  File "/opt/pypy-python2.7/site-packages/psycopg2cffi/_impl/cursor.py", line 26, in check_closed_
    return func(self, *args, **kwargs)
  File "/opt/pypy-python2.7/site-packages/psycopg2cffi/_impl/cursor.py", line 49, in check_async_
    return func(self, *args, **kwargs)
  File "/opt/pypy-python2.7/site-packages/psycopg2cffi/_impl/cursor.py", line 286, in executemany
    self.execute(query, params)
  File "/opt/pypy-python2.7/site-packages/psycopg2cffi/_impl/cursor.py", line 26, in check_closed_
    return func(self, *args, **kwargs)
  File "/opt/pypy-python2.7/site-packages/psycopg2cffi/_impl/cursor.py", line 259, in execute
    self._pq_execute(self._query, conn._async)
  File "/opt/pypy-python2.7/site-packages/psycopg2cffi/_impl/cursor.py", line 692, in _pq_execute
    self._pq_fetch()
  File "/opt/pypy-python2.7/site-packages/psycopg2cffi/_impl/cursor.py", line 753, in _pq_fetch
    raise self._conn._create_exception(cursor=self)
IntegrityError: (psycopg2cffi._impl.exceptions.IntegrityError) duplicate key value violates unique constraint "users_pkey"
DETAIL:  Key (id)=(7) already exists.
 [SQL: u'INSERT INTO users (id, name) VALUES (%(id)s, %(name)s)'] [parameters: ({'id': 7, 'name': 'u7'}, {'id': 8, 'name': 'u8'})]

Comments (7)

  1. Shawn Nock

    I've run into this problem IRL: https://github.com/alex/alchimia/pull/33

    This is caused by pypy's incremental GC not calling _finalize_fairy in a timely manner. Therefore QueuePool doesn't work as expected under Pypy. To use pypy for a non-trivial case requires not using connection pooling (or abusing it to allow for usage that is equivalent to not using conn. pooling).

    This is a known issue: http://doc.pypy.org/en/latest/cpython_differences.html#differences-related-to-garbage-collection-strategies

    There advice is to "fix" programs that relay on CPython's Reference Counting GC:

    The effect that you get in CPython has clearly been described as a side-effect of the implementation and not a language design decision: programs relying on this are basically bogus.

    I cannot think of a way that sqlalchemy could be "fixed". The only solution I could think of is manually gc.collect() when the pool would overflow and retry... but the same Pypy doc has this to say about that:

    Even the naive idea of forcing a full GC when we’re getting dangerously close to the OS’s limit can be very bad in some cases. If your program leaks open files heavily, then it would work, but force a complete GC cycle every n’th leaked file. The value of n is a constant, but the program can take an arbitrary amount of memory, which makes a complete GC cycle arbitrarily long.

    I am hoping you'll have some insight about a work around; but it seems like this may necessarily be a WONTFIX.

    I can submit a patch to detect Pypy and use NullPool (and log a warning) in lieu of QueuePool and/or a documentation patch to explicitly warn that connection pooling is problematic under pypy, but I'd like to hear your thoughts first. I am no sqlalchemy expert.

  2. Michael Bayer reporter

    Theres no bug in SQLAlchemy here except within a very small subset of the test suite and QueuePool works perfectly fine with pypy, as long as you correctly call close() on connections. QueuePool does not rely upon garbage collection to handle connection state, this behavior only takes place if the application or test suite fails to manage a connection before it discards it.

  3. Log in to comment