Skip to content

Thread-safety: _subqueries dict in Compiler is not thread-safe #3

@dtsong

Description

@dtsong

Problem

data_diff/databases/base.py:109 — The _subqueries dictionary in the Compiler class is mutated during query compilation without synchronization.

Impact

Race condition risk in multi-threaded usage, which is common in data-diff's parallel comparison mode.

Suggested Fix

Use a thread-local or add locking around _subqueries access.

References

  • File: data_diff/databases/base.py, line 109

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions