Closed GameMaster47 closed 2 months ago
After some debugging on pysnmp code, I could see that the issue is that the once inside ./hlapi/asyncio/cmdgen.py It seems that nothing is really handling the requestTimedOut exception:
lines 958 - 966
if errorIndication:
yield (
errorIndication,
errorStatus,
errorIndex,
varBindTable and varBindTable[0] or [],
)
if errorIndication != errind.requestTimedOut:
return
After this nothing in the code caughts it and since this is in a run_until_complete loop I guess it causes the loop
I've changed this to
lines 958 - 966
if errorIndication:
yield (
errorIndication,
errorStatus,
errorIndex,
varBindTable and varBindTable[0] or [],
)
#if errorIndication != errind.requestTimedOut:
return
just to test it out and the loop stops, but not sure what's the impact this might have to the rest of the code....
Since we retired the sync API in release 6.2, this issue will not be worked on.
Expected behavior
When trying to iterate over the generator returned by bulkWalkCmd, we'd expect to see an exception raised in case the target host is unreachable or not responding to the getBulk request.
Actual behavior
Instead we see a loop occuring inside the generator, where a getBulk message is repeatedly being sent out.
Detailed steps
We first found this issue on our application code base, but this can be replicated with the sample code provided in https://docs.lextudio.com/pysnmp/docs/hlapi/asyncio/manager/cmdgen/bulkwalkcmd since the demo.pysnmp.com host is unreachable.
Python package information
6.1.2
Operating system information
Ubuntu 22.04.4 LTS
Python information
3.10.12
(Optional) Contents of your test script
Relevant log output