GenomicMedLab / cool-seq-tool

https://coolseqtool.readthedocs.io
MIT License
4 stars 0 forks source link

asyncpg.exceptions._base.InterfaceError when running queries #29

Closed korikuzma closed 10 months ago

korikuzma commented 2 years ago

When running tests that used uta database to make a query, I got the following:

_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
../../../../.local/share/virtualenvs/server-5e63G57x/lib/python3.9/site-packages/uta_tools/data_sources/uta_database.py:144: in execute_query
    return result
../../../../.local/share/virtualenvs/server-5e63G57x/lib/python3.9/site-packages/asyncpg/pool.py:218: in release
    raise ex
../../../../.local/share/virtualenvs/server-5e63G57x/lib/python3.9/site-packages/asyncpg/pool.py:208: in release
    await self._con.reset(timeout=budget)
../../../../.local/share/virtualenvs/server-5e63G57x/lib/python3.9/site-packages/asyncpg/connection.py:1347: in reset
    await self.execute(reset_query, timeout=timeout)
../../../../.local/share/virtualenvs/server-5e63G57x/lib/python3.9/site-packages/asyncpg/connection.py:315: in execute
    return await self._protocol.query(query, timeout)
asyncpg/protocol/protocol.pyx:323: in query
    ???
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

>   ???
E   asyncpg.exceptions._base.InterfaceError: cannot perform operation: another operation is in progress

asyncpg/protocol/protocol.pyx:707: InterfaceError
asyncpg.exceptions._base.InterfaceError: cannot perform operation: another operation is in progress
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    @pytest.mark.asyncio
    async def test_context(variation_context, braf_v600e):
        """Test that context method works correctly."""
>       resp = await variation_context.context("NM_004333.4(BRAF):c.1799T>A:p.Val600Glu",
                                               "braf", "melanoma")
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
Future exception was never retrieved
future: <Future finished exception=ConnectionDoesNotExistError('connection was closed in the middle of operation')>
asyncpg.exceptions.ConnectionDoesNotExistError: connection was closed in the middle of operation

I was able to fix this by setting the connection pool to None and retrying the query.

korikuzma commented 10 months ago

Closing. We haven't had this issue since it was created. We can re-open if it arises in the future