Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

increase timeout to 30s #3422

Merged
merged 6 commits into from
Oct 18, 2024
Merged

increase timeout to 30s #3422

merged 6 commits into from
Oct 18, 2024

Conversation

ahrav
Copy link
Collaborator

@ahrav ahrav commented Oct 16, 2024

Description:

We're seeing frequent context timeout errors during GetObject API calls. This PR increases the default timeout from 5 to 30 seconds.

Error:

RequestCanceled: request context canceled
caused by: context deadline exceeded

Checklist:

  • Tests passing (make test-community)?
  • Lint passing (make lint this requires golangci-lint)?

@ahrav ahrav marked this pull request as ready for review October 16, 2024 00:48
@ahrav ahrav requested a review from a team as a code owner October 16, 2024 00:48
@rosecodym
Copy link
Collaborator

Are we sure that the previous timeout is wrong? My concern is that these timeouts were caused by something other than a bunch of large objects, so if we do this then we won't scan any more data but each scan will take six times as long.

@ahrav
Copy link
Collaborator Author

ahrav commented Oct 18, 2024

Are we sure that the previous timeout is wrong? My concern is that these timeouts were caused by something other than a bunch of large objects, so if we do this then we won't scan any more data but each scan will take six times as long.

According to the documentation for the library we're using:

// GetObject API operation for Amazon Simple Storage Service.
//
// Retrieves an object from Amazon S3.

I believe the timeout was initially set under the assumption that we were only retrieving metadata, but the docs confirm it retrieves the entire object. I'm not certain what else might be causing the context deadline.

@ahrav ahrav requested a review from mcastorina October 18, 2024 18:59
@ahrav
Copy link
Collaborator Author

ahrav commented Oct 18, 2024

Adjusted the logger to use our ctx. I also included the object size in the logger kvp.

Copy link
Collaborator

@mcastorina mcastorina left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems good, just had a few non-blocking questions.

One other thought: can log be removed from the struct now, or is it still referenced in other parts? Not saying it should be removed in this PR, but I saw you corrected many of the log calls to use the passed ctx.

@@ -131,6 +131,7 @@ func (s *Source) setMaxObjectSize(maxObjectSize int64) {
func (s *Source) newClient(region, roleArn string) (*s3.S3, error) {
cfg := aws.NewConfig()
cfg.CredentialsChainVerboseErrors = aws.Bool(true)
cfg.LogLevel = aws.LogLevel(aws.LogDebugWithRequestErrors)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Was this just for testing or are we keeping it in?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought it would be useful even for non-debugging purposes since it would only log during errors. What do you think?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, makes sense to me.

}
obj := *o
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we need to make a shallow copy here?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh whoops, I forgot to remove this. I was testing something. 😅 Thanks.

@ahrav
Copy link
Collaborator Author

ahrav commented Oct 18, 2024

This seems good, just had a few non-blocking questions.

One other thought: can log be removed from the struct now, or is it still referenced in other parts? Not saying it should be removed in this PR, but I saw you corrected many of the log calls to use the passed ctx.

Unfortunately, it's used across the rest of the source 😢 I can clean it up in a separate PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants