Weird bug with APCu and Widgets
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
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.
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
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.