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

Wrapped continuation token with Exception when recursive acl call is … #15839

Conversation

gapra-msft
Copy link
Member

…interrupted

@ghost ghost added the Storage Storage Service (Queues, Blobs, Files) label Sep 30, 2020
/**
* An exception thrown when an operation is interrupted and can be continued later on.
*/
public class DataLakeAclChangeFailedException extends RuntimeException {
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we make it checked exception? That would be compiler enforced reminder to add proper error handling for this api (during design review this was a hot topic - how to write resilient code for this api). Unless there's a guidance (I couldn't find any) or limitation (i.e. reactor doesn't like checked exceptions)

Copy link
Member Author

Choose a reason for hiding this comment

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

Like do you mean defining the method to say " throws DataLakeAclChangeFailedException"?

Copy link
Member Author

@gapra-msft gapra-msft Sep 30, 2020

Choose a reason for hiding this comment

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

It's a good idea but it also doesnt match with all the other APIs where we throw DataLakeStorageExceptoin for network errors

Copy link
Contributor

Choose a reason for hiding this comment

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

throws and make it extend Exception. I'm not sure which one is more important - not standing out (which this API does anyway) or highlight that some error handling should be written to not miss ACL updates as this is SDK responsibility partially with current design. @alzimmermsft what do you think?

Copy link
Member

Choose a reason for hiding this comment

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

Generally we have erred on using Runtime exceptions to prevent downstream code from requiring try/catch blocks everywhere. https://azure.github.io/azure-sdk/java_implementation.html#error-handling

There have been cases in the past where we do use checked exceptions, but those are generally to maintain exception types with a Java language interface.

@srnagar @JonathanGiles for a bit more input.

Copy link
Contributor

Choose a reason for hiding this comment

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

Gotcha. So there is a guidance. Let's stick to it then.

Copy link
Member

Choose a reason for hiding this comment

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

Agree with @alzimmermsft. We should be using appropriate derivatives of RuntimeException for most client library APIs to not force users to write try/catch blocks. Also, it is preferable to use one of the Java runtime exception types or exceptions defined in Azure core instead of creating new custom exceptions unless it is necessary to define a new type.

Copy link
Member Author

@gapra-msft gapra-msft Sep 30, 2020

Choose a reason for hiding this comment

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

I believe we were asked to create a new Exception type from guidance in .NET from Ted and Kryzsztof we are just following suit here as well. The reason we need a custom type is because we need to expose the continuation token to the user.

@gapra-msft gapra-msft marked this pull request as ready for review September 30, 2020 22:50
@gapra-msft gapra-msft merged commit e266b8c into Azure:feature/storage/stg74 Oct 1, 2020
@gapra-msft gapra-msft deleted the storage/recursiveAclWrapContToken branch October 1, 2020 04:59
gapra-msft added a commit that referenced this pull request Oct 1, 2020
* Updated all service versions to STG74 (#14079)

* Added code for get file range diff (#14140)

* Added code for smb multi channel (#14180)

* Added code to allow scheduling file expiry (#14319)

* Added support for arrow output serialization (#14431)

* Added support to read last access time  (#14342)

* Added support to lease shares (#14287)

* Updated file ranges to getFileRangesDiff (#14839)

* Added support for directory and delegation SAS (#14531)

* Recursive acl (#14669)

* Added missing error code (#14986)

* Added tests to ensure support for 4TB file (#15179)

Co-authored-by: Gauri Prasad <[email protected]>

* Storage/file share error code (#15007)

* Fixed simple renames and doc issues from 74 (#15297)

Co-authored-by: Gauri Prasad <[email protected]>

* Added back support for container undelete. (#15344)

* Regenerated code to address APIView comments (#15341)

* Minor changelog formatting issues

* Formatting - new lines and unused imports

* Fixed public API for file get range diff (#15562)

* Modified recursive acl tests to be able to play in live mode (#15815)

* Added support for live tests in the STG 74 branch (#15724)

* Added code to return batch failures in results for recursive ACL (#15842)

* Wrapped continuation token with Exception when recursive acl call is … (#15839)

Co-authored-by: Gauri Prasad <[email protected]>
Co-authored-by: Rick Ley <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Storage Storage Service (Queues, Blobs, Files)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants