duckietown / duckietown-shell

Other
3 stars 6 forks source link

No timeout in CURL call #12

Closed afdaniele closed 6 years ago

afdaniele commented 6 years ago

https://github.com/duckietown/duckietown-shell/blob/5c10e1538f43ca62bad8bf3a24aca10c6d3541b0/lib/dt_shell/version_check.py#L36

This call to curl does not appear to have a timeout specified. I was running the shell with no internet and the program hanged for at least 10 seconds. I killed after that and saw that the program was stuck at this line. Is this lack of timeout intended?

AndreaCensi commented 6 years ago

@afdaniele are you using Mac?

The curl fallback is because urllib2 on Mac has problems with https.

AndreaCensi commented 6 years ago

For the timeout, yes there should be one.

afdaniele commented 6 years ago

@AndreaCensi , I hit the issue with https on Mac as well. I use requests instead. Check here: https://github.com/duckietown/duckietown-shell/blob/13ed1a4fd9ea4ce8001e92577d45c9766022eeec/lib/dt_shell/cli.py#L156.