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

feat: Propagate InterruptedException during feed loading #869

Merged
merged 1 commit into from
Apr 26, 2021

Conversation

aababilov
Copy link
Collaborator

@aababilov aababilov commented Apr 23, 2021

InterruptedException is a sign to immediately stop validation. We may not just add a notice and keep on validating.

IBM wrote an article on the subject:
http://web.archive.org/web/20210201071452/https://www.ibm.com/developerworks/java/library/j-jtp05236/index.html

If throwing InterruptedException means that a method is a blocking method, then calling a blocking method means that your method is a blocking method too, and you should have a strategy for dealing with InterruptedException. Often the easiest strategy is to throw InterruptedException yourself, as shown in the putTask() and getTask() methods in Listing 1. Doing so makes your method responsive to interruption as well and often requires nothing more than adding InterruptedException to your throws clause.

@aababilov aababilov force-pushed the InterruptedException branch 2 times, most recently from 624361b to 4232772 Compare April 23, 2021 06:28
IBM wrote an article on the subject:
http://web.archive.org/web/20210201071452/https://www.ibm.com/developerworks/java/library/j-jtp05236/index.html

If throwing InterruptedException means that a method is a blocking method, then calling a blocking method means that your method is a blocking method too, and you should have a strategy for dealing with InterruptedException. Often the easiest strategy is to throw InterruptedException yourself, as shown in the putTask() and getTask() methods in Listing 1. Doing so makes your method responsive to interruption as well and often requires nothing more than adding InterruptedException to your throws clause.
@aababilov aababilov force-pushed the InterruptedException branch 2 times, most recently from 525af47 to ff2757b Compare April 23, 2021 06:47
Copy link
Contributor

@lionel-nj lionel-nj left a comment

Choose a reason for hiding this comment

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

Thanks @aababilov for working on this. Will keep the documentation you attached handy so that we can make sure to replicate this mechanism if needed in the future.

@aababilov
Copy link
Collaborator Author

Thanks for review!

Could you merge it? I still don't have permissions to do that on my own.

@lionel-nj lionel-nj merged commit 31b33ff into MobilityData:master Apr 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants