-
Notifications
You must be signed in to change notification settings - Fork 246
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
Replace nonpublic Accumulo Threads with new Datawave equivalent #2520
Conversation
This is the bare minimum to move to Datawave. If you'd like me to include the same functionality as the Accumulo version I can do that. |
warehouse/core/src/main/java/datawave/util/threads/DatawaveUncaughtExceptionHandler.java
Outdated
Show resolved
Hide resolved
warehouse/core/src/main/java/datawave/util/threads/Threads.java
Outdated
Show resolved
Hide resolved
// If e == OutOfMemoryError, then it's probably that another Error might be | ||
// thrown when trying to print to System.err. | ||
} finally { | ||
Runtime.getRuntime().halt(-1); |
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.
Actually, I really do not like halting. I realize the accumulo one did this, but in the context of a BulkInputFormat, we certainly do not want to halt the vm which would most likely be a yarn container.
Instead, lets save off the exception, and then add finaly blocks above to check if exceptions were thrown so that we can pass them back up.
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.
see comment
*/ | ||
@Override | ||
public void uncaughtException(Thread t, Throwable e) { | ||
Throwable savedException = null; |
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 was not clear. This savedException should be a member of this class. In the BulkInputFormat we should check whether that member has an exception and subsequently pass the exception up. I don't think throwing an exception in this method would actually be passed up as it would be in a separate thread.
Also why all of the changes to the docker files in this PR ? |
78ad9e5
to
2525399
Compare
org.apache.accumulo.core.util.threads.Threads
is not part of Accumulo's public API. The variableUEH
is the only part of the class used in Datawave.Created
datawave.util.threads.DatawaveUncaughtExceptionHandler
anddatawave.util.threads.Threads
which are similar to the Accumulo classes.Replace all references of Accumulo's
Threads
andAccumuloUncaughtExceptionHandler
with the Datawave classes.part of #2443