@Override
    public void run() {
        try (MdcCloseable ignored = MdcUtils.withContext(MdcUtils.asContextData(jobId))) {
            doRun();
        } finally {
            terminationFuture.complete(executionState);
        }
    }
@Test
    public void testCleanupWhenInvokeFails() throws Exception {
        createTaskBuilder()
                .setInvokable(InvokableWithExceptionInInvoke.class)
                .build(Executors.directExecutor())
                .run();
        assertTrue(wasCleanedUp);
    }