primoze
primoze2y ago

deno_runtime inspector service not starting...

Hi! I'm embedding deno_runtime, and I can't get the inspector working. I set BootstrapOptions.inspect to true, and WorkerOptions maybe_inspector_server and should_break_on_first_statement. The server is set to listen on 127.0.0.1:9229. server in inspector_server.rs is called, and prints
Debugger listening on ws://127.0.0.1:9229/ws/5b5725e4-ac19-4f4d-ba1b-f6d44ce9430f
Visit chrome://inspect to connect to the debugger.
Deno is waiting for debugger to connect.
Debugger listening on ws://127.0.0.1:9229/ws/5b5725e4-ac19-4f4d-ba1b-f6d44ce9430f
Visit chrome://inspect to connect to the debugger.
Deno is waiting for debugger to connect.
but make_svc function is never called (I added some printlins), and netstat shows the port is not in use, and chrome doesn't find it either. Permissions are allow all, cert errors are ignored, I can post the entire setup if required... Everything is created and running inside run_local, and the versions are 0.160.0 and 0.86.0 for core and runtime respectively (but a few older versions also didn't work). What am I missing? Are there any other options relevant to starting the inspector service?
8 Replies
bartlomieju
bartlomieju2y ago
not really, it should spawn a separate OS thread and start inspector server there is server function called at all?
primoze
primoze2y ago
yes, server is called and there are no errors from hyper::server::Builder
bartlomieju
bartlomieju2y ago
are you sure it doesn't hit other branches like with_graceful_shutdown? it's very strange that only service function wouldn't be called
primoze
primoze2y ago
huh, you're right. that's the branch i didn't add the println before
bartlomieju
bartlomieju2y ago
cool!
primoze
primoze2y ago
i guess the inspector gets dropped, now i have to figure out why. thanks!
bartlomieju
bartlomieju2y ago
yeah, you need to store the InspectorServer for the whole duration of the program
primoze
primoze2y ago
yeah, i thought i did but i guess i was mistaken about some lifetime rules. anyway i found the issue immediately, thanks again