If provided cancellation token gets cancelled during execution of InnerExecuteAsync method and any listener code checks token and throws exception it gets lost because regardless of cancellation token state finally block gets executed where PreInvalidateCachesAsync method checks token again and throws exception of its own. I would advice to not call that method if cancellation was requested and allow exception to bubble.
If provided cancellation token gets cancelled during execution of
InnerExecuteAsync
method and any listener code checks token and throws exception it gets lost because regardless of cancellation token state finally block gets executed wherePreInvalidateCachesAsync
method checks token again and throws exception of its own. I would advice to not call that method if cancellation was requested and allow exception to bubble.https://github.com/nhibernate/nhibernate-core/blob/8a1b0848c3a521f1d99d48c1817487b9e514ec51/src/NHibernate/Async/Engine/ActionQueue.cs#L55-L66