Closed (fixed)
Project:
Search API
Version:
8.x-1.15
Component:
Framework
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
3 Dec 2019 at 09:33 UTC
Updated:
20 Feb 2020 at 10:49 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
abrar_arshad commentedHere is the patch. Just re-checking the operations variable for any item and if so, calling the destruct() again
Comment #3
drunken monkeyThanks for reporting this problem and already providing a patch!
Please set the status to “Needs review”, though, when posting a patch that works for you. This makes it easier to spot issues that already have patches.
In any case, while the patch looks simple enough, I had to clean up the code style a bit (see the Drupal coding standards) and also made sure that this won’t lead to an infinite recursion.
Please test/review!
Comment #4
abrar_arshad commentedNoted. Thanks for reviewing it. I will soon review the patch but it looks good. Just one concern, as there could be potentially other cases where iteration could go beyond one-time recursion. Technically the limitation still exists, in my opinion.
- There could be a global setting to adjust the recursiveness
- Or, allow at least 5 recursions in the acknowledgement of the limit with the acceptable default behaviour as apposed to one-time recursion.
What do you say?
Comment #5
drunken monkeyI would say that this scenario is already extremely unlikely. I’m not aware of any code in any project I know that triggers indexing based on an indexing operation, and doing this more than once seems pretty absurd. Does this actually happen in your use case, or is this a hypothetical?
It’s also worth noting that not recursing when needed doesn’t really break anything – indexing will just wait until the next cron run instead of happening immediately.
So, for the sake of simplicity, I think I’d prefer recursing just once. But if there’s a reasonable use case for this, I’m also open to recursing more often (change is simple – patch attached).
Would also be interesting to hear other’s input on this.
Comment #6
abrar_arshad commentedThanks and apologize for delay. This patch is good.
I have another sort of a related concern pls - already provided a patch: https://www.drupal.org/project/search_api/issues/3108219.
Comment #8
drunken monkeyThanks for reporting back, and no worries about the short delay – as you see, I’m the last who should complain about that. ;)
Great to hear the patch still works for you. Then: committed.
Thanks again!
Comment #9
abrar_arshad commentedThanks for committing.