Open banky opened 9 months ago
I've forked the repo to try out adding timeouts if anyone else has this issue. I initially thought that the tokio::time::timeout
function would correctly check that the function does not take too long. But there is some long running non-async stuff so the timeout doesn't work. I got around this by adding a bunch of tokio::time::sleep(tokio::time::Duration::from_millis(1)).await;
to serve as yield points. Any help would be appreciated if someone knows a better way to do this!
Instead of random sleeps, I believe yeld_now is the right thing to use to force a long running task to hand back execution to the runtime. Ideally, you'd find the loops for which each iteration is taking long and add a yield at the end of each round.
Thank you for the assistance, I'll continue to dig into this. Even with the timeouts, the requests eventually start failing so there is some underlying issue that I'm not seeing
Is it possible to set a timeout for simulations? If it's not currently implemented, perhaps someone can guide me on how I'd do this? (I'm new to Rust) After running a large number of tx simulations, the requests start to take too long and begin to pile up. It starts out fine, each request takes about 500ms, but then after a few hours, they start to take almost 2 minutes sometimes