jetty.project
jetty.project copied to clipboard
Jetty 12: Review SerializedInvoker.Link.getInvocationType()
Jetty version(s) 12
Description
SerializedInvoker.Link.getInvocationType() currently returns hardcoded BLOCKING.
This is because a blocking task can be offered while a non-blocking one is running, so the thread running the non-blocking task may assume that the task currently running is non-blocking, but then executes a blocking one that was offered concurrently.
This strategy works, but assumes the worst case, which may result in unnecessary threads hand-overs, for example for HTTP/2 DATA frames, where an application could pass a NON_BLOCKING Runnable to Request.demand(Runnable).
Review whether we can improve on this logic, possibly having the thread offering the blocking task wait until previous non-blocking tasks are run.