[platform] IJPL-223937: Propagate context to read action checks for rescheduling

Since lambda passed to `backendExecutor.execute(r)` is ContextAwareRunnable we should handle context ourselves

GitOrigin-RevId: 450d1f069520b870384956785f3f67af9b1019bd
This commit is contained in:
Nikolay Rykunov
2025-12-15 19:19:26 +00:00
committed by intellij-monorepo-bot
parent 11068cb986
commit 7919f276af
@@ -561,7 +561,18 @@ public final class NonBlockingReadActionImpl<T> implements NonBlockingReadAction
}
finally {
if (builder.myCoalesceEquality != null) {
release();
if (AppExecutorUtil.propagateContext()) {
// `release` should be called under [myChildContext] as well
// since it executes some code to check when to call computation, and this code may rely on the context
// e.g. in analyzer: Application and Project are stored in context and `release` uses Application
ThreadContext.installThreadContext(myChildContext.getContext(), true, () -> {
release();
return Unit.INSTANCE;
});
}
else {
release();
}
}
}
};