jetty.project icon indicating copy to clipboard operation
jetty.project copied to clipboard

Jetty 12: Review SerializedInvoker.Link.getInvocationType()

Open sbordet opened this issue 2 years ago • 3 comments
trafficstars

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.

sbordet avatar Jul 10 '23 16:07 sbordet