Automattic / hostmgr

A tool for managing macOS VM hosts
Mozilla Public License 2.0
8 stars 3 forks source link

Set the timeout of S3 clients to 30 minutes #35

Closed crazytonyli closed 1 year ago

crazytonyli commented 1 year ago

When running hostmgr sync vm_images --force, I constantly got errors like this:

2022-08-30T07:14:29+0000 trace com.automattic.hostmgr : ahc-connection-id=4 ahc-el=NIOTransportServices.NIOTSEventLoop ahc-request-id=4 aws-operation=GetObject aws-request-id=4 aws-service=s3 Request was cancelled
2022-08-30T07:14:29+0000 debug com.automattic.hostmgr : aws-error-message=HTTPClientError.deadlineExceeded aws-operation=GetObject aws-request-id=4 aws-service=s3 AWSClient errorError: HTTPClientError.deadlineExceeded

After a bit investigation, I found the soto-core library uses a 20 seconds timeout by default, which isn't enough to download an image from S3. In this PR I added a timeout value of 30 minutes.