Thanks for this cool project.
If I run this code, session.run doesn't return after 1 second, it returns after the full 3 seconds with an exception. Is this intended? Im hitting this problem in a much more complicated use-case but I boiled (some of it) down to this example. This is obviously contrived but adversarial code could block the sandbox like this for a long time, potentially indefinitely.
from micropython_wasm import MicroPythonSession
import time
session = MicroPythonSession(wall_timeout_seconds=1)
started = time.monotonic()
try:
print("starting")
session.run(
"import time\n"
"time.sleep(3)\n"
"print(\"done\")\n")
print("returned")
finally:
elapsed = time.monotonic() - started
print(f"elapsed={elapsed:.1f}s")
session.close()
Thanks for this cool project.
If I run this code, session.run doesn't return after 1 second, it returns after the full 3 seconds with an exception. Is this intended? Im hitting this problem in a much more complicated use-case but I boiled (some of it) down to this example. This is obviously contrived but adversarial code could block the sandbox like this for a long time, potentially indefinitely.