I suspect there could be a race condition between task creation / result completion, and pause of a session. But I don't have time to check for now.
I think we keep a consistent state of the session. We read it only once so if it changes during we keep the old state. Marginally, there will be some tasks submitted when the session is paused and some tasks will not be notified the session has been resumed and will submit paused tasks.
I think we keep a consistent state of the session. We read it only once so if it changes during we keep the old state. Marginally, there will be some tasks submitted when the session is paused and some tasks will not be notified the session has been resumed and will submit paused tasks.