Repository navigation
Conversation
There was a problem hiding this comment.
Spelling: I think this should be "propagates".
|
Thanks for fixing this; the test looks good to me, but I think we might want to preserve the old behavior of also performing error cleanup when Throwables are thrown (i.e. by using the |
|
Sounds like a good plan. |
|
Would it not make more sense to just catch/rethrow throwables? (That way if fail during cleanup we can pass back an exception indicating that cleanup failed + the underlying cause as well)? |
|
I think that my concern was that wrapping a Throwable with a cause and re-throwing it might not be safe in general because catchers higher up the stack would then receive a different exception than the original Throwable, which might lead to problems if the throwable was an Error that's treated specially (e.g. ThreadDeath). I suppose one approach would be to not re-wrap the Throwable when re-throwing. but AFAIK the compiler will complain if you re-throw It looks like Java 7 provides us with a nice way to handle this with try-with-resources (see https://stuartmarks.wordpress.com/2011/07/21/a-new-java-exception-handling-idiom/), but I don't think we can use this here as long as we want to backport this fix to 1.4.1, which still must build for Java 6. I think that's why I originally decided to go with the |
|
Test build #35360 has finished for PR 6918 at commit
|
|
Test build #35375 has finished for PR 6918 at commit
|
|
Test build #35376 has finished for PR 6918 at commit
|
There was a problem hiding this comment.
You could potentially use Utils.tryWithSafeFinally, which does this sort of annoying "try/catch in a try/catch" thing.
There was a problem hiding this comment.
This class, along with a lot of the other Tungsten code, is written in Java, so we can't use Utils.tryWithSafeFinally here.
|
Test build #35422 has finished for PR 6918 at commit
|
There was a problem hiding this comment.
Shouldn't we log in the else branch to make sure that the error is never silently swallowed?
|
LGTM pending Jenkins; thanks! |
|
Test build #35528 has finished for PR 6918 at commit
|
|
Merging this to |
…e writer Author: Holden Karau <holden@pigscanfly.ca> Closes #6918 from holdenk/SPARK-8498-fix-npe-in-errorhandling-path-in-unsafeshuffle-writer and squashes the following commits: f807832 [Holden Karau] Log error if we can't throw it 855f9aa [Holden Karau] Spelling - not my strongest suite. Fix Propegates to Propagates. 039d620 [Holden Karau] Add missing closeandwriteoutput 30e558d [Holden Karau] go back to try/finally e503b8c [Holden Karau] Improve the test to ensure we aren't masking the underlying exception ae0b7a7 [Holden Karau] Fix the test 2e6abf7 [Holden Karau] Be more cautious when cleaning up during failed write and re-throw user exceptions (cherry picked from commit 0f92be5) Signed-off-by: Josh Rosen <joshrosen@databricks.com>
|
Dammit, I just realized that the |
…e writer Author: Holden Karau <holden@pigscanfly.ca> Closes apache#6918 from holdenk/SPARK-8498-fix-npe-in-errorhandling-path-in-unsafeshuffle-writer and squashes the following commits: f807832 [Holden Karau] Log error if we can't throw it 855f9aa [Holden Karau] Spelling - not my strongest suite. Fix Propegates to Propagates. 039d620 [Holden Karau] Add missing closeandwriteoutput 30e558d [Holden Karau] go back to try/finally e503b8c [Holden Karau] Improve the test to ensure we aren't masking the underlying exception ae0b7a7 [Holden Karau] Fix the test 2e6abf7 [Holden Karau] Be more cautious when cleaning up during failed write and re-throw user exceptions (cherry picked from commit 0f92be5) Signed-off-by: Josh Rosen <joshrosen@databricks.com>
No description provided.