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

HystrixRequestLog shows [Executed] after all commands have delivered values #847

Closed
mattrjacobs opened this issue Aug 3, 2015 · 4 comments

Comments

@mattrjacobs
Copy link
Contributor

crossposted from https://groups.google.com/forum/#!topic/hystrixoss/tiJlm32RHTQ

@mattrjacobs
Copy link
Contributor Author

Unit test that checks HystrixRequestLog directly after command timeout in a loop has not shown the error.

However, I did inadvertently see the same symptom by only waiting for 1 out of n HystrixCommands to error in a single request. That reproduced the symptom, as seen by the thread above.

@mattrjacobs
Copy link
Contributor Author

I can't reproduce this, so marking as 'Invalid' until I/others have a reproducible case. If you can reproduce this, please re-open this issue or open a new one

@mattrjacobs
Copy link
Contributor Author

From the Google Group thread referenced above:

It looks like this only happens when the sub-command throws HystrixBadRequestException. I was able to reproduce this consistently with a unit test consisting of 1 semaphore based command that executes two thread-based commands. The first sub-command succeeds, the second I force a HystrixBadRequestException to be thrown. The command log ends up looking like this.

TestCommand[Executed][31ms], TestCommand3[SUCCESS][16ms], TestCommand2[Executed][0ms]

Since HystrixEventType has a BAD_REQUEST value, I am expecting this...

TestCommand[BAD_REQUEST][31ms], TestCommand3[SUCCESS][16ms], TestCommand2[BAD_REQUEST][0ms]

I then tried just having a single command that throws a HystrixBadRequestException (i.e. got rid of the sub-commands in the test) and even when I just execute a single request it reports the status as Executed rather than BAD_REQUEST.

@mattrjacobs mattrjacobs reopened this Aug 17, 2015
mattrjacobs pushed a commit to mattrjacobs/Hystrix that referenced this issue Aug 25, 2015
@mattrjacobs
Copy link
Contributor Author

This turned out to not be due to a race condition at all - just that the HystrixRequestLog was not being updated upon BadRequestExceptions. This is now fixed in 1.4.x and master. I also added more strict testing of HystrixRequestLog contents, and only found this missing case. After this is released, I would not expect you to see this condition again.

Thanks for helping get to the root of it.

mattrjacobs added a commit that referenced this issue Aug 25, 2015
Fixed #847 by adding BAD_REQUEST to the HystrixRequestLog
mattrjacobs added a commit that referenced this issue Aug 25, 2015
…quest-log

Fixed #847 by adding BAD_REQUEST to the HystrixRequestLog
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant