Skip to content

Race condition in Table.update_or_insert() #439

Open
@nextghost

Description

@nextghost

Table.update_or_insert() and Table.validate_and_update_or_insert() should use _for_update=True when checking whether the record already exists. Otherwise there is a risk that the record will be deleted or (if it does not exist) inserted by a concurrent thread, leading to either database error or inconsistent data.

Adapters which don't support for_update locking should just silently ignore the parameter instead of raising exception (or at most log a warning).

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions