Runs the given task synchronously, returning when the task has completed or throwing an exception if the task fails. It is up to the {@code TransactionScheduler} implementation to decide when to run thistask, so the task may be run immediately or it might be queued behind waiting tasks. The task may be handed off to another thread of control for execution. In all cases, the caller will block until the task completes or fails permanently.
As with all methods of {@code TransactionScheduler}, tasks run with {@code runTask} will be run transactionally. If the caller is notin an active transaction, then a transaction is created to run the task. If the caller is already part of an active transaction, then the task is run as part of that transaction, and the {@code owner}paramater is ignored.
When the caller is not part of an active transaction, then when the given task completes it will also attempt to commit. If committing the transaction fails, normal re-try behavior is applied. If the task requests to be re-tried, then it will be re-run according to the scheduler implementation's policy. In this case, {@code runTask}will not return until the task finally succeeds, or is no longer re-tried.
In the event that the caller is part of an active transaction, then there is no re-try applied in the case of a failure, and the transaction is not committed if the task completes successfully. This is because the system does not support nested transactions, and so the decision to commit or re-try is left to the active transaction.
@param task the {@code KernelRunnable} to execute
@param owner the entity on who's behalf this task is run
@throws TaskRejectedException if the given task is not accepted
@throws InterruptedException if the calling thread is interrupted andthe associated task does not complete
@throws Exception if the task fails and is not re-tried