79357393

Date: 2025-01-15 07:47:29
Score: 5
Natty:
Report link

I think this should have been a comment, but i have no reputation so i can't comment.

I'm seeing the exact same issue as the OP, running python 3.12, and pysnmp 7.1.15.

One possible workaround is to wrap the snmp command in asyncio.wait_for().

    task = asyncio.create_task(
        bulk_cmd(
            snmpDispatcher,
            CommunityData("public"),
            await UdpTransportTarget.create(("127.0.0.1", 161), timeout=0.3),
            0,
            20,
            *varBinds,
        )
    )

    try:
        await asyncio.wait_for(task, timeout=10)
    except TimeoutError:
        print("Timeout")

    errorIndication, errorStatus, errorIndex, varBindTable = task.result()

This is absolutely an ugly hack.

Reasons:
  • RegEx Blacklisted phrase (1): can't comment
  • RegEx Blacklisted phrase (1.5): reputation
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Me too answer (2.5): I'm seeing the exact same issue
  • Low reputation (1):
Posted by: Peter Krüpl