lucidsoftware / apt-boto-s3

The fast and simple S3 transport for apt.
Apache License 2.0
56 stars 13 forks source link

Connect/ReadTimeout of boto3 results in hanging #30

Open paulpfeiffer1988 opened 5 years ago

paulpfeiffer1988 commented 5 years ago

Hi! When the internet connection isn´t available during connection time boto3 throws an Connection Error. Unfortunately apt only hangs during apt-get update & apt-get install (on my ubuntu16 machine).

If you add

            except botocore.exceptions.EndpointConnectionError as e:
                self.send(Message(MessageHeaders.URI_FAILURE, (
                        ('Message', e),
                        ('URI', uri),
                )))
                raise e

to the try/except of *s3_response = s3_object.get(*s3_request) it will fail better. By the Way, is there a better way than raising the Exception there?

Furthermore if the internet connection breaks during package download, apt also hangs up bytes = s3_response['Body'].read(16 1024)* throws an ReadTimeout If you put there:

                       try:
                            bytes = s3_response['Body'].read(16 * 1024)
                       except Exception as e:
                            self.send(Message(MessageHeaders.URI_FAILURE, (
                                ('Message', e),
                                ('URI', uri),
                            )))
                            raise e

it will fail (whats correctly, if the internet is broken?!

paulpfeiffer1988 commented 5 years ago

OK I´m sorry my solutions are only working with v1 not with the most recent but I think the error ist there the same... apt seems to hang up