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

Bubble Throwables when executing Runnables #112

Merged
merged 1 commit into from
Nov 13, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ public Daemon(String pathToExecutable, MessageHandler handler, String workingDir
lenBuf.order(ByteOrder.BIG_ENDIAN);
rcvBuf.order(ByteOrder.BIG_ENDIAN);

executor.submit(new Runnable() {
executor.execute(new Runnable() {
@Override
public void run() {
try{
Expand Down Expand Up @@ -285,7 +285,7 @@ private void returnMessage() {
* from the child process.
*/
private void startLoops() {
executor.submit(new Runnable() {
executor.execute(new Runnable() {
@Override
public void run() {
while (!shutdown.get()) {
Expand All @@ -294,7 +294,7 @@ public void run() {
}
});

executor.submit(new Runnable() {
executor.execute(new Runnable() {
@Override
public void run() {
while (!shutdown.get()) {
Expand All @@ -303,7 +303,7 @@ public void run() {
}
});

executor.submit(new Runnable() {
executor.execute(new Runnable() {
@Override
public void run() {
while (!shutdown.get()) {
Expand All @@ -312,7 +312,7 @@ public void run() {
}
});

executor.submit(new Runnable() {
executor.execute(new Runnable() {
@Override
public void run() {
while (!shutdown.get()) {
Expand Down Expand Up @@ -438,7 +438,7 @@ private void startChildProcess() throws IOException, InterruptedException {
}


executor.submit(new Runnable() {
executor.execute(new Runnable() {
@Override
public void run() {
try {
Expand Down Expand Up @@ -468,8 +468,8 @@ public void apply(Logger logger, String message) {
}
});

executor.submit(stdOutReader);
executor.submit(stdErrReader);
executor.execute(stdOutReader);
executor.execute(stdErrReader);
try {
int code = process.waitFor();
fatalError("Child process exited with code " + code, code != 1);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ public void rejectedExecution(Runnable r, ThreadPoolExecutor executor) {
private class MessageHandler implements Daemon.MessageHandler {
@Override
public void onMessage(final Message m) {
callbackCompletionExecutor.submit(new Runnable() {
callbackCompletionExecutor.execute(new Runnable() {
@Override
public void run() {
if (m.hasPutRecordResult()) {
Expand All @@ -154,7 +154,7 @@ public void onError(final Throwable t) {

// Fail all outstanding futures
for (final Map.Entry<Long, SettableFuture<?>> entry : futures.entrySet()) {
callbackCompletionExecutor.submit(new Runnable() {
callbackCompletionExecutor.execute(new Runnable() {
@Override
public void run() {
entry.getValue().setException(t);
Expand Down