google-code-export / s3ql

Automatically exported from code.google.com/p/s3ql
0 stars 0 forks source link

Catch no network errors #370

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Rather than full stackstrace, should print nice error message ("Not connected 
to the internet?")

Oct 13 17:06:07 vostro backup:   File '/usr/lib/python2.7/socket.py', line 553, 
in create_connection(address=('nikratio-backup.s3.amazonaws.com', 80), 
timeout=<object object>, source_address=None)
Oct 13 17:06:07 vostro backup:     for res in getaddrinfo(host, port, 0, 
SOCK_STREAM):
Oct 13 17:06:07 vostro backup:   Current bindings:
Oct 13 17:06:07 vostro backup: res undefined
Oct 13 17:06:07 vostro backup:     getaddrinfo = <built-in function 
getaddrinfo> (global)
Oct 13 17:06:07 vostro backup:     host = 'nikratio-backup.s3.amazonaws.com'
Oct 13 17:06:07 vostro backup:     port = 80
Oct 13 17:06:07 vostro backup:     SOCK_STREAM = 1 (global)
Oct 13 17:06:07 vostro backup:
Oct 13 17:06:07 vostro backup: Exception: gaierror: [Errno -2] Name or service 
not known
Oct 13 17:06:07 vostro backup:   args = (-2, 'Name or service not known')
Oct 13 17:06:07 vostro backup:   errno = -2
Oct 13 17:06:07 vostro backup:   filename = None
Oct 13 17:06:07 vostro backup:   message = ''
Oct 13 17:06:07 vostro backup:   strerror = 'Name or service not known'

Original issue reported on code.google.com by Nikolaus@rath.org on 14 Oct 2012 at 8:16

GoogleCodeExporter commented 9 years ago
It's actually rather hard to keep track if we're doing the first connection 
attempt (in which case we should terminate with an error message if there's no 
network connection) or if this is a reconnection (in which case we should sleep 
and try again instead of aborting and unmounting the file system). 

Therefore, starting with revision 6dd2e28a3790, S3QL will just always retry in 
case of any network errors (but a warning message is printed to the console). 

Original comment by Nikolaus@rath.org on 16 Jan 2013 at 4:41

GoogleCodeExporter commented 9 years ago
Actually, that's revision 8e5797dcceb6.

Original comment by Nikolaus@rath.org on 16 Jan 2013 at 4:45