Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,8 @@ private static EnumSet<ExcludeType> exclude(Class<?> clazz) {
SKIP_TYPE_PREFIXES
.get(ExcludeType.EXECUTOR)
.add("io.netty.util.concurrent.SingleThreadEventExecutor.");
// OkHttp's TaskRunner Runnable is a long-lived worker loop, not a single submitted task.
SKIP_TYPE_PREFIXES.get(ExcludeType.RUNNABLE).add("okhttp3.internal.concurrent.TaskRunner$");
// Don't wrap Runnables belonging to NioEventLoop(s) as they want to propagate CloseException
// outside of the event loop on close() and wrapping them in FutureTask interferes with that
SKIP_TYPE_PREFIXES.get(ExcludeType.RUNNABLE).add("com.aerospike.client.async.NioEventLoop");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,12 @@ class ExcludeFilterTest extends DDSpecification {
type << ExcludeFilter.ExcludeType.values()
}

def "exclude OkHttp TaskRunner worker from Runnable propagation"() {
Comment thread
amarziali marked this conversation as resolved.
expect:
ExcludeFilter.exclude(RUNNABLE, 'okhttp3.internal.concurrent.TaskRunner$runnable$1')
!ExcludeFilter.exclude(EXECUTOR, 'okhttp3.internal.concurrent.TaskRunner$runnable$1')
}

static class One {}

static class Another {}
Expand Down
Loading