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

ISPN-4677 Map/Reduce job fails with the wrong explanation on TimeoutException #2844

Closed
wants to merge 1 commit into from

Conversation

vblagoje
Copy link

@vblagoje vblagoje commented Sep 5, 2014

Master only. See https://issues.jboss.org/browse/ISPN-4677 for discussion and rationale.

@@ -671,8 +671,7 @@ protected void executeMapPhaseWithLocalReduction(Map<KOut, VOut> reducedResult)
Throwable cause = ee.getCause();
if (cause instanceof org.infinispan.util.concurrent.TimeoutException) {
throw new ExecutionException("Map phase executing at " + mapTaskPart.getAddress()
+ " did not complete within " + rpcOptionsBuilder.timeout(TimeUnit.SECONDS) + " sec timeout",
cause);
+ " did not complete", cause);
} else {
throw ee;
Copy link
Member

Choose a reason for hiding this comment

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

Looking at this closer, is there a reason we just don't throw the underlying cause? That is usually more customary when rethrowing an ExecutionException.

Copy link
Author

Choose a reason for hiding this comment

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

Because Sanne suggested that we be more descriptive about the exception cause. It however turned out that we have more than one reason why this call may timeout with TimeoutException. So it is incorrect to claim that the "call did not complete within " certain timeout. That is why the wording is a bit more generic. I really think we should not spend more time on this "trivial" issue :-)

Copy link
Member

Choose a reason for hiding this comment

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

Throwing the outer ExecutionException doesn't provide any additional information though. It just exposes underlying implementation details showing that we most likely use an ExecutorService is all. Think what I was trying to say might have got lost in translation.

Copy link
Author

Choose a reason for hiding this comment

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

Aha, I get you! Yeah, it makes sense to peel off ExecutionException I think. No reason for it to be there if after all we throw CacheException to the client. Let me experiment and see what the effect is!

Copy link
Author

Choose a reason for hiding this comment

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

Actually I think this is ok @wburns We want to provide additional information about Map phase executing at certain node not completing.

@vblagoje
Copy link
Author

@Sanne @wburns @danberindei let me know if this makes more sense now.

future.get();
try {
future.get();
} catch (Exception e) {
Copy link
Member

Choose a reason for hiding this comment

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

Thinking if we got an ExecutionException we should unwrap that and put the cause in the MapReduceException instead so we don't have another cause by in stack that really provides no benefit.

Copy link
Member

Choose a reason for hiding this comment

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

Also looking at this closer, I don't like the idea that we are just rewrapping the InterrruptedException. It may be the best thing but normally I like to propagate those to the caller if it is possible to respond in a better fashion. Maybe that isn't possible here.

Copy link
Author

Choose a reason for hiding this comment

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

Yep, you are right! I'll unwrap ExecutionException and propagate InterruptedException. Thanks @wburns

@vblagoje
Copy link
Author

vblagoje commented Oct 6, 2014

Rebased and ready for furher review. @wburns @danberindei could you please have a look

@danberindei
Copy link
Member

Integrated, thanks Vladimir!

@danberindei danberindei closed this Oct 8, 2014
@Sanne
Copy link
Member

Sanne commented Oct 8, 2014

great, thanks!!

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