sqlite-object-cache icon indicating copy to clipboard operation
sqlite-object-cache copied to clipboard

Weird bug with APCu and Widgets

Open nickchomey opened this issue 7 months ago • 3 comments

When I have APCu on, creating and modifying classic widgets has very sporadic behaviour. It seems to always apply in the db, but doesnt seem to apply in APCu. It works fine with APCu off, or with Redis Object Cache.

I tried step debugging it, but wasn't able to get to the bottom of the issue.

Here's a screen recording. Not sure what else to say!

https://github.com/user-attachments/assets/60305879-0a14-44bc-9f75-b7a2b313cc7e

nickchomey avatar Jun 08 '25 00:06 nickchomey

Nick, sorry for ignoring this for so long.

It looks like you're working with the block widgets, not classic. At any rate I'm having a hard time reproducing this.

I wonder, do you have a production site and a staging clone installed on the same server using the same apache or php-fpm worker process pool? Maybe there's a collision between APCU tags.

OllieJones avatar Oct 03 '25 18:10 OllieJones

This was all done in local dev, single site, in docker container.

(and not sure why i called it classic widgets - clearly they're blocks)

My focus is elsewhere at the moment, so i cant dig in again. I'll follow-up when i notice it again

nickchomey avatar Oct 03 '25 20:10 nickchomey

Hmmm. I wonder if the block editor is capable of sending concurrent REST requests that concurrently attempt to update options in the alloptions object. That would be a surefire way of exposing the race condition. But surely some of the big memcached or redis sites (wordpress.com among them) would have struggled with this.

When you get some time, please check stuff again. As I said, I couldn't reproduce what you showed me.

OllieJones avatar Oct 09 '25 00:10 OllieJones