Skip to content

Commit

Permalink
Move onThreadStart execution hook after check that wrapping thread ti…
Browse files Browse the repository at this point in the history
…med out
  • Loading branch information
Matt Jacobs committed Jan 20, 2015
1 parent f0c4c90 commit c8d2fec
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -512,15 +512,15 @@ private Observable<R> getRunObservableDecoratedForMetricsAndErrorHandling(final

@Override
public void call(Subscriber<? super R> s) {
executionHook.onThreadStart(_self);
executionHook.onRunStart(_self);
if (isCommandTimedOut.get() == TimedOutStatus.TIMED_OUT) {
// the command timed out in the wrapping thread so we will return immediately
// and not increment any of the counters below or other such logic
s.onError(new RuntimeException("timed out before executing run()"));
} else {
// not timed out so execute
try {
executionHook.onThreadStart(_self);
executionHook.onRunStart(_self);
threadPool.markThreadExecution();
// store the command that is being run
endCurrentThreadExecutingCommand.set(Hystrix.startCurrentThreadExecutingCommand(getCommandKey()));
Expand Down

0 comments on commit c8d2fec

Please sign in to comment.