akarneliuk / pygnmi

The pure Python implementation of the gNMI client.
https://training.karneliuk.com
BSD 3-Clause "New" or "Revised" License
126 stars 44 forks source link

timeout or gnmi-timeout doesn't seem to work #130

Closed lucasalvatore closed 10 months ago

lucasalvatore commented 1 year ago

if a device is unreachable for whatever reason, none of the timeout options seem to work. Seems like some default value of around 1 minute is used. Code is:

with gNMIclient(target=(device.name,6030), username='admin', password='xxx', skip_verify=True, gnmi_timeout=20,timeout=20) as gc:
        result = gc.get(path=['components/component[name=Supervisor1-EOS]'])
        return result

I'm trying both gnmi_timeout and timeout to 20 seconds. If a device is not reachable, the script hangs for at least 1 minute instead of the 20 seconds. Am i missunderstanding the timeout agrs here perhaps?

akarneliuk commented 10 months ago

Hey @lucasalvatore , that sounds interesting. If the device is not reachable, say, if you make ping, do you get responses immediately? or do you have any FW in the path, which doesn't rsend any response packets in case of not successful response? Best, Anton