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

Move thread completion to end of chain #449

Merged

Conversation

mattrjacobs
Copy link
Contributor

Thread completion events (metrics and hook execution) were firing earlier in 1.4.x, as documented by #377, and discovered via #327. This PR moves them back to the rightful place at the end of the Observable chain. Along the way, 2 unrelated bugs were fixed.

  1. Hystrix.startCurrentThreadExecutingCommand() and the corresponding end Action0 were being invoked twice per command. Now they both invoked once
  2. As documented in Mismatch in isExecutedInThread documentation #448, HystrixCommand.isExecutedInThread() was documented to only return true when it actually ran in the Hystrix thread. In practice, it was returning true in the case that it was set up to run in a thread, but got rejected. Fixing this made the implementation of the thread completion straightforward.

Matt Jacobs added 2 commits January 6, 2015 16:09
…readExecutingCommand

sequence once per command invocation
…rvable chain (Netflix#377)

* Both thread pool metrics and the onThreadComplete execution hook now run later
* Modified behavior of HystrixCommand.isExecutedInThread() to match the Javadoc (Netflix#448)
** Now this returns true iff the Hystrix thread executed the run() method
@cloudbees-pull-request-builder

Hystrix-pull-requests #200 SUCCESS
This pull request looks good

mattrjacobs added a commit that referenced this pull request Jan 7, 2015
…d-of-chain

Move thread completion to end of chain
@mattrjacobs mattrjacobs merged commit 3f6f95a into Netflix:master Jan 7, 2015
@mattrjacobs mattrjacobs deleted the move-thread-completion-to-end-of-chain branch January 19, 2015 21:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants