-
Notifications
You must be signed in to change notification settings - Fork 138
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
[dap] improve dap startup and shutdown #914
Conversation
TheGeorge
commented
Feb 16, 2021
•
edited
Loading
edited
- shutdown dap and send events when project node goes down
- ensure, that we don't double monitor nodes
- shutdown project node when we get a disconnect request
- add config for cookie and startup timeout
16b2474
to
800b8ee
Compare
it made sense to merge #915 and this one into one PR. |
@robertoaloi can you take a look? |
% connect and monitore project node | ||
case els_distribution_server:wait_connect_and_monitor(Node, Timeout) of | ||
ok -> inject_dap_agent(Node); | ||
_ -> stop_debugger() |
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 could be just error
, right?
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.
In this case we could crash, and let the supervisor handle the error behavior.
timer:sleep(?WAIT_INTERVAL), | ||
case connect_and_monitor(Node) of | ||
ok -> | ||
ok; | ||
error -> | ||
?LOG_WARNING( "Trying to connect to node ~p (~p/~p)" | ||
, [Node, ?WAIT_ATTEMPTS - Attempts + 1, ?WAIT_ATTEMPTS]), | ||
wait_connect_and_monitor(Node, Attempts - 1) | ||
, [Node, MaxAttempts - Attempts + 1, MaxAttempts]), |
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.
Out of curiosity, why do we need this change?
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.
I added a config parameter, that makes the connection timeout configurable. This change displays the connection attemps correctly (e.g. 12/30)
% connect and monitore project node | ||
case els_distribution_server:wait_connect_and_monitor(Node, Timeout) of | ||
ok -> inject_dap_agent(Node); | ||
_ -> stop_debugger() |
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 could just be error
, right?