[j-nsp] PYEZ module hangs

santiago martinez santiago.martinez.uk at gmail.com
Mon Nov 5 17:57:05 EST 2018


Have you tried attaching a debugger and see where is hanging? 
santiago

Sent from my iPhone

> On 6 Nov 2018, at 01:48, serge vautour <sergervautour at gmail.com> wrote:
> 
> Hello,
> 
> I'm having problems with the import of PYEZ module hanging. My python
> script:
> 
> from jnpr.junos import Device
> def main():
> blah = ""
> 
> if __name__ == "__main__":
>    main()
> 
> That's as simple as possible. When I remove the "from jnpr.junos" line, the
> problem described below goes away.
> 
> When I run this using a unix for loop I get:
> 
> [root at xxxx]# for i in {1..100}; do echo $i;time python test.py ; done
> 1
> 
> real    0m0.725s
> user    0m0.635s
> sys     0m0.092s
> 2
> 
> real    0m0.647s
> user    0m0.567s
> sys     0m0.082s
> 3
> 
> real    0m0.654s
> user    0m0.573s
> sys     0m0.084s
> 
> etc...
> 
> Eventually, and this appears completely random, it will hang:
> 
> 35
> 
> real    0m0.650s
> user    0m0.572s
> sys     0m0.079s
> 36
> ^\Quit
> 
> real    0m27.527s
> user    0m0.360s
> sys     0m0.059s
> 37
> ^\Quit
> 
> real    0m11.761s
> user    0m0.350s
> sys     0m0.067s
> 38
> ^\Quit
> 
> real    0m51.663s
> user    0m0.357s
> sys     0m0.062s
> 
> The ^\Quit is me killing that instance of the python script with ctrl-\. If
> I wait long enough it unblocked by itself:
> 
> 39
> 
> real    2m55.709s   <--- It eventually unblocked on it's own
> user    0m0.588s
> sys     0m0.079s
> 40
> 
> real    0m0.647s
> user    0m0.573s
> sys     0m0.076s
> 41
> 
> real    0m0.647s
> user    0m0.575s
> sys     0m0.074s
> 42
> 
> How long it takes once hung is random. How often it hangs is random.
> Sometimes I can run it over a 1000 times without an issue.
> 
> I am on the latest version of python and of the module (I think):
> [root at xxxxxx# python
> Python 2.7.5 (default, Feb 20 2018, 09:19:12)
> [GCC 4.8.5 20150623 (Red Hat 4.8.5-28)] on linux2
> Type "help", "copyright", "credits" or "license" for more information.
>>>> from jnpr.junos import version
>>>> print version.VERSION
> 2.2.0
> 
> Just today I ran the PIP command to update PYEZ and all dependencies. The
> problem is still present.
> 
> This is running on a VM with lots of resources (32G RAM, 8CPU). top shows
> less than 1G RAM in use and nearly no CPU usage even with it hangs. I have
> tried running the same code on a different VM (on a different physical
> chassis) with the same version of python and PYEZ and cannot reproduce.
> 
> Any suggestions on how to troubleshoot this? Is it possible it's the
> underlying VM Hardware or virtualization software?
> 
> Thanks,
> Serge
> _______________________________________________
> juniper-nsp mailing list juniper-nsp at puck.nether.net
> https://puck.nether.net/mailman/listinfo/juniper-nsp


More information about the juniper-nsp mailing list