OllieJones / sqlite-object-cache

A WordPress persistent object cache for the rest of us.
GNU General Public License v2.0
24 stars 4 forks source link

Pre-v3.24 SQLite: Race condition under heavy load upserting cache value. #9

Closed OllieJones closed 1 year ago

OllieJones commented 1 year ago

Aharon (@spaceling) reported a race condition that caused a duplicate key exception.

SQLite pre version 3.24 does not support single statement UPSERT operations. In this case the plugin attempts an update, and if the update affected no rows it does an insert. Those two operations need to be in a single transaction.

https://wordpress.org/support/topic/uncaught-exception-unable-to-execute-statement-column-name-is-not-unique/

OllieJones commented 1 year ago

v1.1.0, fixed.