Fixed Thread.sleep() issue inside Fiber. (#4326)

This commit is contained in:
Michele Sollecito 2018-11-29 16:41:16 +00:00 committed by GitHub
parent 488f11e2e6
commit 628aa0b799
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -224,7 +224,7 @@ class FlowStateMachineImpl<R>(override val id: StateMachineRunId,
} catch (t: Throwable) {
if(t.isUnrecoverable()) {
logger.error("Caught unrecoverable error from flow. Forcibly terminating the JVM, this might leave resources open, and most likely will.", t)
Thread.sleep(Duration.ofSeconds(10).toMillis()) // To allow async logger to flush.
Fiber.sleep(Duration.ofSeconds(10).toMillis()) // To allow async logger to flush.
Runtime.getRuntime().halt(1)
}
logger.info("Flow raised an error... sending it to flow hospital", t)