You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When Relevanssi 4.8 and Snitch are active at the same time, the site crashes in an infinite loop. Reproducing this is simple: on an empty WP site, install Relevanssi 4.8 and Snitch and then activate both at the same time.
Here's what happens:
When Snitch is activated, it does some logging with log_response().
In order to do the logging, it creates a post using wp_insert_post().
This fires up Relevanssi indexing.
This triggers an asynchronous doc count updating request, even though the post wasn’t actually indexed.
This action fires up another thread of WP, where Snitch wants to do logging…
…which gets us back to 2 for an infinite loop.
The fix on Relevanssi end is fairly simple. There's no reason for the async doc count request to run if the post wasn't indexed, so from next version onwards, Relevanssi will check for that and that will break us from the infinite loop right away. Thus, there's no immediate need to change anything in Snitch. However, I wanted to inform you about this, as similar issues may crop up with other plugins, and perhaps there's something in your end to stop such infinite loops from forming in the future.
The text was updated successfully, but these errors were encountered:
patrickrobrecht
changed the title
Relevanssi 4.8 + Snitch = infinite loop
Snitch causes infinite loop in combination with other plugins (Relevanssi and WeGlot)
Dec 31, 2020
Well, Relevanssi has been changed so that Snitch and Relevanssi don't cause an infinite loop again, but Snitch will cause an infinite loop with any other plugin that reacts to post creation with an asynchronous action that starts a new instance of WP, causing Snitch to log and create a post that will cause the other plugin to react and so on...
I guess it's pretty hard to stop Snitch from having this problem, because it's hard to tell when you're coming from a loop, but this tendency for infinite loops is something to think about. Perhaps Snitch could flag that it's currently doing a logging action and avoid starting a new logging action while one is in progress?
When Relevanssi 4.8 and Snitch are active at the same time, the site crashes in an infinite loop. Reproducing this is simple: on an empty WP site, install Relevanssi 4.8 and Snitch and then activate both at the same time.
Here's what happens:
log_response()
.wp_insert_post()
.The fix on Relevanssi end is fairly simple. There's no reason for the async doc count request to run if the post wasn't indexed, so from next version onwards, Relevanssi will check for that and that will break us from the infinite loop right away. Thus, there's no immediate need to change anything in Snitch. However, I wanted to inform you about this, as similar issues may crop up with other plugins, and perhaps there's something in your end to stop such infinite loops from forming in the future.
The text was updated successfully, but these errors were encountered: