Skip to content

drop(): after the engine refuses to delete every file, the Python handle still counts as open #554

Todo

Description

@tae898

Package

Both (arcadedb and arcadedb-jvm)

Package version

main at 75e8290 on an engine with PR 13609 (upstream 2026-11-27, so 26.12.1)

Expected behavior

When db.drop() raises because the engine could not delete every file, the Python handle says what the engine says: the database is closed. db.is_open() is False, a later db.close() (for example from with) does nothing, and the native package forgets the handle.

Actual behavior

From reading the code, I have not made a drop fail. Since PR 13609, LocalDatabase.drop() closes the database, deletes the files, and then throws DatabaseOperationException ("was closed but its files could not be deleted") when an entry is left. The bindings set their closed flag only after a drop that returns:

  • arcadedb-jvm, Database.drop() in core.py: self._closed = True comes after self._java_db.drop(), so after the error the handle still counts as open and close() calls the engine's close() on a closed database.
  • arcadedb, drop() in _native/database.py: the same, and arcadedb_n_close in ArcadeNative.java throws before DBS.remove(h), so the registry keeps the closed database.

Before PR 13609 the engine only logged a warning and returned, so this could not happen.

Steps to reproduce

On Linux or macOS, with an engine that has PR 13609:

import os, arcadedb
db = arcadedb.create_database("/tmp/drop-fails")
os.chmod("/tmp/drop-fails", 0o500)  # no entry of the directory can be removed
try:
    db.drop()
except arcadedb.ArcadeDBError as e:
    print(e)
print(db.is_open())  # expected False
db.close()           # expected to do nothing

This does not block 26.12.1: the drop already fails with a clear error, and #552 documents it. A fix sets the closed flag (and removes the native handle) when the engine reports the database closed, with a regression test that makes the drop fail on Linux and macOS.

Activity

  1. self-assigned this
    on Nov 30, 2026
  2. added
    bug
    native
    jvm
    on Nov 30, 2026
  3. added
    python
    on Nov 30, 2026
  4. added this to the 27.1.1 milestone on Nov 30, 2026
  5. added this to the 26.12.1 milestone on Nov 30, 2026
  6. modified the milestones: 26.12.1, 27.1.1 on Nov 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugjvmnativepython

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions