-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(xsnap-worker): require explicit $XSBUG_HOST
for debugging
#18
Conversation
The makefile for xsnap builds both debug and release versions of the tool. The release version has xsbug support compiled out (see |
I thought we resolved the debug build mode design in Agoric/agoric-sdk#2578 (under the original title of XS / xsnap build mode: debug? production? mix?) but I don't see a clear resolution. In any case, let's do get clear on what the issue is. It sounds like a weird performance issue, but it's not entirely clear to me how to reproduce it. What are the steps, @michaelfig ? |
Oh, is that the intent? The release version of I'll put together a PR that implements the behaviour you describe for |
nc -l localhost 5002 </dev/null & then switch to another terminal: xsnap-native/xsnap/build/bin/mac/release/xsnap-worker Notice that the first terminal looks like: <xsbug><login name="xsnap" value="XS"/></xsbug> and the output from top shows 99% CPU: 61715 xsnap-worker 99.3 00:07.27 1/1 0 14 41M 0B 0B 61715 2543 running *0[1] 0.00000 |
Yes, as I say, this is the result of considerable design discussion under Agoric/agoric-sdk#2578 p.s. found the resolution: Agoric/agoric-sdk#3776 , which depends on #1 here.
I'm still not clear on what new information merits revisiting the earlier design decision. So I guess I don't mind if you make such a PR, but let's not land it until we are clear on the issue and get buy-in from all the stakeholders in the earlier decision. |
Note the discussion in Agoric/agoric-sdk#3776 includes:
So this behavior when something is running on port 5002 is by design, at least to some extent. We weren't aware of this potential performance impact, though. That's new information. |
Okay, then I stand by this PR. I see we want Semi-related to this, I'll put up a PR that at least stops the spinning. But I would much rather prevent the connection entirely under release mode. |
If the sole goal is to require else {
strcpy(name, "localhost");
port = 5002;
} ...to this? else {
return;
} |
60bda98
to
4405ac5
Compare
Thanks for the quick change. That looks reasonable to me (from an XS perspective; I cannot speak to the comments raised by @dckc regarding Agoric's goals here). |
4405ac5
to
ac327f0
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks consistent with earlier decisions.
I wonder if XSBUG_HOST merits mention in https://github.com/Agoric/agoric-sdk/blob/master/docs/env.md
I see XSNAP_DEBUG
from SwingSet/src/controller.js is not documented there. Ideally both would be documented there, but this PR is OK independent of that.
I was dismayed to find
xsnap-worker
spinning for a minute before becoming responsive. As it turns out, my machine was running a different service onlocalhost:5002
, and the worker was in a loop trying to connect to it, expecting it wasxsbug
.To fix
xsnap-worker
, I reset the defaultxsbug
port to-1
, and short-circuit out of the debug connection in that case. If you need to debug the worker, just explicitly useXSBUG_HOST=localhost:5002 ./xsnap-worker ...
.