GithubHelp home page GithubHelp logo

Comments (10)

musicinmybrain avatar musicinmybrain commented on July 18, 2024 1

Thanks! I presume this is also related to garbage collection but between tests now. #569 may resolve.

I will check this next.

from databases.

musicinmybrain avatar musicinmybrain commented on July 18, 2024 1
* `i686` in 5/5 builds

I should not have tested this architecture; it is excluded in the Fedora package, which is why the build failed every time.

from databases.

zanieb avatar zanieb commented on July 18, 2024

Thanks for raising! This test as added as part of #561 — I believe an operational error should be raised there because a new database should be created on the second connection. I'm not certain of the details of how the shared in-memory database is cleared when its reference is dropped, we'll probably need to investigate that.

from databases.

zanieb avatar zanieb commented on July 18, 2024

Can you give 1d30e39 a try?

from databases.

musicinmybrain avatar musicinmybrain commented on July 18, 2024

Can you give 1d30e39 a try?

When applied as a patch to 0.8.0, that commit seemed to fix the failure reported in this bug in local testing. However, I’m now encountering the following on the real builders:

=================================== FAILURES ===================================
_____________________ test_should_remove_ref_on_disconnect _____________________
    @async_adapter
    async def test_should_remove_ref_on_disconnect():
        async with Database("sqlite:///file::memory:?cache=shared", uri=True) as database:
            query = sqlalchemy.schema.CreateTable(notes)
>           await database.execute(query)
tests/test_databases.py:1582: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
databases/core.py:199: in execute
    return await connection.execute(query, values)
databases/core.py:318: in execute
    return await self._connection.execute(built_query)
databases/backends/sqlite.py:145: in execute
    await cursor.execute(query_str, args)
/usr/lib/python3.12/site-packages/aiosqlite/cursor.py:48: in execute
    await self._execute(self._cursor.execute, sql, parameters)
/usr/lib/python3.12/site-packages/aiosqlite/cursor.py:40: in _execute
    return await self._conn._execute(fn, *args, **kwargs)
/usr/lib/python3.12/site-packages/aiosqlite/core.py:133: in _execute
    return await future
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
self = <Connection(Thread-142, started 281473458041216)>
    def run(self) -> None:
        """
        Execute function calls on a separate thread.
    
        :meta private:
        """
        while True:
            # Continues running until all queue items are processed,
            # even after connection is closed (so we can finalize all
            # futures)
            try:
                future, function = self._tx.get(timeout=0.1)
            except Empty:
                if self._running:
                    continue
                break
            try:
                LOG.debug("executing %s", function)
>               result = function()
E               sqlite3.OperationalError: table notes already exists
/usr/lib/python3.12/site-packages/aiosqlite/core.py:106: OperationalError

I don’t see this in every build; I haven’t yet established whether it is flaky (racy) or arch-dependent, and I don’t understand why I haven’t been able to reproduce it locally.

from databases.

zanieb avatar zanieb commented on July 18, 2024

Thanks! I presume this is also related to garbage collection but between tests now. #569 may resolve.

from databases.

musicinmybrain avatar musicinmybrain commented on July 18, 2024

I don’t see this in every build; I haven’t yet established whether it is flaky (racy) or arch-dependent, and I don’t understand why I haven’t been able to reproduce it locally.

In five scratch-builds for Fedora Rawhide across all architectures, I saw the above failure on:

  • x86_64 in 1/5 builds
  • i686 in 5/5 builds
  • ppc64le in 0/5 builds
  • s390x in 1/5 builds
  • aarch64 in 3/5 builds

So it looks like this is present on all architectures but perhaps with different probability.

from databases.

musicinmybrain avatar musicinmybrain commented on July 18, 2024

Thanks! I presume this is also related to garbage collection but between tests now. #569 may resolve.

I will check this next.

#569 worked in an initial scratch build. I’ll try it a few more times to make sure there aren’t any other (frequent) flaky failures.

from databases.

musicinmybrain avatar musicinmybrain commented on July 18, 2024

#569 looks good to me. No failures in five builds on each architecture. Thanks for investigating this.

from databases.

zanieb avatar zanieb commented on July 18, 2024

Thanks for your help!

from databases.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.