piskvorky / sqlitedict

Persistent dict, backed by sqlite3 and pickle, multithread-safe.
Apache License 2.0
1.16k stars 130 forks source link

Fix interrupted iteration over a SqliteDict instance #134

Closed Cologler closed 2 years ago

Cologler commented 3 years ago

Fixes #69.

When GC collected the _QueueReader, the _CancelableQueue will mark as canceled, so no more new items can be added to the queue.

mpenkov commented 3 years ago

Thank you for your contribution! Is it possible to add tests?

Cologler commented 3 years ago

Thank you for your contribution! Is it possible to add tests?

Not sure how to test it. Does any CI support add 10GB files?

Cologler commented 2 years ago

Seem like using weakref is the better way to handle this.