fix useless usage of dispatch() in the same cycle with aync IO #28
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hi! As discussed in previous undertow issue, Undertow does not let you both dispatch() and start async IO in the same dispatch cycle. Here dispatch() creates another redundant thread and may report some redundant errors in more complex cases.
One case I met is in my graph processing library based on Flink Statefun. I have two ingress stream, one edge stream for ingression of edges and another edge stream for query. Every vertex in a graph corresponds to a Function and each of them can pass messages to each other to do some computation (such as finding connected component). With the number of edges and vertexed increasing (in my case using the
email_mini_edges_undirected
which has 1000 edges), it will need more complex compuation and may be the reason to cause the following errors when dealing with query stream.One interesting find is that these errors does not affect the correctness of final results of the query stream. They just bump out serveral times and seem to be in different redundant handling threads.
After deleting the
exchange.dispatch();
statement inUndertowHttpHandler
, these errors disappeared. Juding from the previous undertow issue I mentioned, I guess that would be a useless invoke ofdispatch()
here and can be safely removed.