-
Notifications
You must be signed in to change notification settings - Fork 25.2k
Fix S3RepositoryAnalysisRestIT
#126593
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
Fix S3RepositoryAnalysisRestIT
#126593
Conversation
- Translate a 404 during a multipart copy into a `FileNotFoundException` - Use multiple threads in `S3HttpHandler` to avoid `CopyObject`/`PutObject` deadlock Closes elastic#126576
Hi @DaveCTurner, I've created a changelog YAML for you. |
Pinging @elastic/es-distributed-coordination (Team:Distributed Coordination) |
Actually |
e669e4a
to
ca89288
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for doing this!
if (e instanceof AmazonServiceException ase && ase.getStatusCode() == RestStatus.NOT_FOUND.getStatus()) { | ||
throw new NoSuchFileException(blobName, null, e.getMessage()); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd hit this during my own testing and thought I'd fixed it in copyBlob
(so that it would translate for single part as well). I am slapping my head noticing now that executeMultipart
is wrapping AmazonClientException
in IOException
so this doesn't actually kick in on the multipart copy path, but I wonder if it's better to unwrap back in copyBlob
, or to hoist the wrapping out of executeMultipart
into writeBlob
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I played around with that but it ends up being a bit weird catching a 404 in writeBlob
and friends since it doesn't really make sense for a single upload, and only makes sense for multipart uploads if they are aborted concurrently. I'm going to leave it as it is for now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, I'd meant not wrapping AmazonServiceException
into IOException
in executeMultipart
, but rather in writeBlob
. That way this 404 handler here could just disappear, since the copyBlob
handler would then handle it. But it's a trivial difference really.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sorry, I guess you mean that multipart upload (not copy) can also return a 404 (I suppose if the upload itself is cancelled while parts are being uploaded). I don't think we were catching that before, but if that's the issue then I see what you mean (though I don't know if a writeBlob caller would make the distinction).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah maybe we can tidy this up a bit but I'm going to keep this PR focussed on just getting the SDKv2 tests passing again
- Translate a 404 during a multipart copy into a `FileNotFoundException` - Use multiple threads in `S3HttpHandler` to avoid `CopyObject`/`PutObject` deadlock Closes elastic#126576 (cherry picked from commit b10b35f)
Translate a 404 during a multipart copy into a
FileNotFoundException
Use multiple threads in
S3HttpHandler
to avoidCopyObject
/PutObject
deadlockCloses #126576