You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
CompletableFuture has several method such as thenRunAsync or thenComposeAsync which take a lambda and run it on a threadpool. These come in two variants: a single argument version which runs on the 'default' threadpool and one where a pool is provided.
In the context of Pravega we always use the supplied thread pool version so that we can control the pool the function is run on as well as have clearly named threads in stack traces and logs.
This means that leaving off the second parameter is almost certainly a mistake, but it one that is easy to make as the code compiles and easy to miss in code review because the name of the method is the same.
We should add a checkstyle rule to detect these sorts of accidents and correct the ones which exist in the code base.
The text was updated successfully, but these errors were encountered:
Describe the bug
CompletableFuture has several method such as
thenRunAsync
orthenComposeAsync
which take a lambda and run it on a threadpool. These come in two variants: a single argument version which runs on the 'default' threadpool and one where a pool is provided.In the context of Pravega we always use the supplied thread pool version so that we can control the pool the function is run on as well as have clearly named threads in stack traces and logs.
This means that leaving off the second parameter is almost certainly a mistake, but it one that is easy to make as the code compiles and easy to miss in code review because the name of the method is the same.
We should add a checkstyle rule to detect these sorts of accidents and correct the ones which exist in the code base.
The text was updated successfully, but these errors were encountered: