aiowmi icon indicating copy to clipboard operation
aiowmi copied to clipboard

RecursionError: maximum recursion depth exceeded

Open markdueck1 opened this issue 9 months ago • 1 comments

Hi all,

Running 8-10 queries to around 80 different windows devices (various versions) every 5 minutes. After running for around 20h response time shoots up and this error is found. Running using gunicorn, first time this happened it was running default workers (1) and 4 threads. Second time running 8 workers and 4 threads.

To Reproduce Still working on reproducing the error consistently. I get the callstack below, seeing it over and over in the logs


Fatal error: protocol.data_received() call failed.
protocol: <aiowmi.protocol.Protocol object at 0x7fd531060750>
transport: <_SelectorSocketTransport fd=15 read=polling write=<idle, bufsize=0>>
Traceback (most recent call last):
  File "/usr/lib/python3.11/asyncio/selector_events.py", line 1013, in _read_ready__data_received
    self._protocol.data_received(data)
  File "/app/aiowmi/protocol.py", line 90, in data_received
    self.data_received(more)
  File "/app/aiowmi/protocol.py", line 90, in data_received
    self.data_received(more)
  File "/app/aiowmi/protocol.py", line 90, in data_received
    self.data_received(more)
  [Previous line repeated 974 more times]
  File "/app/aiowmi/protocol.py", line 82, in data_received
    more = self._buf.append(data)
           ^^^^^^^^^^^^^^^^^^^^^^
RecursionError: maximum recursion depth exceeded

Additional context the "failed to connect to" errors may not be related but I have a bunch of them surrounding this error. failed to connect to $ipaddress (49909); fallback to $ipaddress (49909)...

markdueck1 avatar Mar 17 '25 00:03 markdueck1

I can only imagine this happens with a "never" ending flow of data, thus when data can't be processed faster than it is being received. This way the data_received(..) function will be called from itself, without ever being completed.

joente avatar Mar 24 '25 11:03 joente