-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
WatchIT fails with vertx #4884
Comments
@manusa @vietj The thread checking message is not the full cause - the message will be repeated every 2 seconds while the watcher waits. Instead the attempt to patch is failing to get a response. In general this test is not great and likely needs to be removed, but there are a couple of take-aways:
|
This test needs refactoring, I'm not even sure what's specifically testing (it looks like the test verifies the full watch round trip). 1Why is the Patch failing to get a response? Why isn't it either throwing Exception? Which brings to the question of 2 ### I don't think that users are aware of the consequences of blocking in the |
I think it was added because previous watch error handling lead to concurrent calls on the watcher.
The problem is not with patch being applied, it appears that for vertx holding the watcher thread prevents the processing of the patch response.
It is in the javadoc and FAQ.
Yes it came up again with #4803
That was only used in places where the callbacks were assumed to be blocking, such as writing to outputstreams, so that the httpclient threads could continue. A watcher, nor things like execlisteners, do not have serialexecutor handling. |
I know, but the fact that it's documented doesn't mean that people are aware of it 😅 From a UX perspective (and considering the answer to my last assumption) it might be of interest for us to schedule the execution of the callbacks on an isolated Executor. I'm not sure of what might the drawbacks of this be, but it would certainly simplify a lot the usage of the client downstream. |
Now that we have a centrally managed executor for the client we are in a better place to do this. When changes around threading were initially undertaken that wasn't available - so you would have ended up yet again with one off pools. The drawbacks are - more code complexity on our side, and for a subset of those who do this eventual memory issues unless we also add a cap to serialexecutor queue length. |
Places with calls on http threads:
Places that are ok:
|
Looking more at the vertx execution it looks like submitting the patch ends up getting watch event handled on the same event loop (which has a single threaded execution) as will handle the patch response. @vietj is this expected? |
Vertx detects the sleep as a blocked thread:
The text was updated successfully, but these errors were encountered: