Closed vdnhi closed 3 years ago
Please post a stack trace.
@mlissner It here
File "scorched/search.py", line 630, in execute
ret = self.interface.search(**self.options())
File "scorched/search.py", line 624, in options
options = super(SolrSearch, self).options()
File "scorched/search.py", line 561, in options
options.update(_attr.options())
File "scorched/search.py", line 61, in options
s = self.__unicode_special__()
File "scorched/search.py", line 211, in __unicode_special__
self, _ = self.normalize()
File "scorched/search.py", line 153, in normalize
_s, changed = s.normalize()
File "scorched/search.py", line 153, in normalize
_s, changed = s.normalize()
File "scorched/search.py", line 153, in normalize
_s, changed = s.normalize()
File "scorched/search.py", line 153, in normalize
_s, changed = s.normalize()
File "scorched/search.py", line 153, in normalize
_s, changed = s.normalize()
File "scorched/search.py", line 153, in normalize
_s, changed = s.normalize()
File "scorched/search.py", line 153, in normalize
_s, changed = s.normalize()
File "scorched/search.py", line 153, in normalize
_s, changed = s.normalize()
File "scorched/search.py", line 153, in normalize
_s, changed = s.normalize()
File "scorched/search.py", line 153, in normalize
_s, changed = s.normalize()
File "scorched/search.py", line 153, in normalize
_s, changed = s.normalize()
File "scorched/search.py", line 153, in normalize
_s, changed = s.normalize()
File "scorched/search.py", line 153, in normalize
_s, changed = s.normalize()
File "scorched/search.py", line 153, in normalize
_s, changed = s.normalize()
File "scorched/search.py", line 153, in normalize
_s, changed = s.normalize()
File "scorched/search.py", line 153, in normalize
_s, changed = s.normalize()
File "scorched/search.py", line 153, in normalize
_s, changed = s.normalize()
File "scorched/search.py", line 153, in normalize
_s, changed = s.normalize()
File "scorched/search.py", line 153, in normalize
_s, changed = s.normalize()
File "scorched/search.py", line 153, in normalize
_s, changed = s.normalize()
File "scorched/search.py", line 153, in normalize
...
normalize
function has called 945 times before exceed the recursion depth.
It might help to post what version you're on. That stack trace doesn't line up with master, but I don't know how far master is away from the latest release.
A case to reproduce would help too.
It is version 0.13.0. I can't point out the case it went wrong because of multi complex logic above this call. But when I compared my code I am using, there is no different in implementation of normalize
function. Could you help me to figure out the potential reason that make this function exceed the maximum recursion depth?
My guess is you have a very long list of sub - queries. We need the quiet to be sure. If that's the case, the fix doesn't seem easy to me.
You should also know this library is unmaintained. I wouldn't use it for a new project until it shows real signs of life.
Does this function can be rewritten not use recursion but use stack?
Dunno, but the PR is extremely unlikely to be merged.
I also had this problem when adding a long list of UUIDs to be ignored to a query. I solved it by calling .normalize()
on the query object while building the query. This reduced the necessity for scorched
to normalize my query and kept it under the recursion limit.
I am using this library but met an error of maximum recursion depth exceeded in this function. Does anyone have any idea to fix this?
https://github.com/lugensa/scorched/blob/master/scorched/search.py#L146
cc @lujh @mlissner