You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
:clear
:dep tokio = {version = "1.17.0", features = ["full"]}
executing the following cell twice leads to two different behaviours:
async fn foo() {
panic!("hello")
}
foo().await
First execution:
thread '' panicked at 'hello', src/lib.rs:3:5
stack backtrace:
note: Some details are omitted, run with RUST_BACKTRACE=full for a verbose backtrace.`
Second execution:
thread '' panicked at 'called Result::unwrap() on an Err value: PoisonError { .. }', src/lib.rs:100:63
stack backtrace:
note: Some details are omitted, run with RUST_BACKTRACE=full for a verbose backtrace.
Obviously, there is nothing one can do about the first error, however, the second error is problematic, as the only way recovering from this seems to be to issue a :clear and dep tokio again. This is "bad", because all other state is also lost.
I assume this PoisonError stems from the mutex on the runtime introduced in #90.
It would be nice if we could either:
only clear the cached runtime
or in case of a panic in the block_on thread automatically invalidate the cached runtime to create a new one on the next async call.
This should then allow to keep using variables that eventually were created in a different runtime (as long as they are Sync/Send...)??!
Either way, like what you are doing here - if I find some time and you are interested in contributions I might actually give it a shot ;-)
The text was updated successfully, but these errors were encountered:
Or recreating the runtime. This could work by moving the mutex generation into the lazy_arc method, e.g. one could check if the mutex in the returned arc is poissoned and recreate it in that case.
System: windows
evcxr: 0.15.1
With the following init block
executing the following cell twice leads to two different behaviours:
First execution:
Second execution:
Obviously, there is nothing one can do about the first error, however, the second error is problematic, as the only way recovering from this seems to be to issue a
:clear
anddep tokio
again. This is "bad", because all other state is also lost.I assume this
PoisonError
stems from the mutex on the runtime introduced in #90.It would be nice if we could either:
block_on
thread automatically invalidate the cached runtime to create a new one on the next async call.This should then allow to keep using variables that eventually were created in a different runtime (as long as they are Sync/Send...)??!
Either way, like what you are doing here - if I find some time and you are interested in contributions I might actually give it a shot ;-)
The text was updated successfully, but these errors were encountered: