-
Notifications
You must be signed in to change notification settings - Fork 207
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
Shutdown actions are not getting completed, when launch is terminated and launches it again immediately #832
Comments
@jonahgraham , Could you please share your thoughts? |
Very odd and doesn't match the behaviour I see. Are you a CDT user or a CDT developer as the correct follow up depends on which path you are on. CDT User Please let me know what shutdown activities you are not seeing run. How do you know they aren't run (e.g. missing expected commands in gdb traces or hardware not left in expected state) CDT Dev Can you share what is terminating the executor too soon? Can you put breakpoints DefaultDsfExecutor and some service to see them getting shutdown improperly. What I see I can see the a message like this (with tracing on):
But that shutdown method should only be called if the launch is terminated (i.e org.eclipse.debug.core.Launch.isTerminated() returns true) What I can see is that gdb is closed cleanly higher up in the log before the shutdown.
|
OK, I can see what is happening - GDB and other runtime processes attached to the launch are shutting down cleanly, leading to I think GdbLaunch (subclass of Launch) should not return true from isTerminated until the full shutdown sequence is complete in Here is a quickly coded change that may fix this. Can you test/modify this and provide it as a PR? I think it should probably not rely on state of diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/launching/GdbLaunch.java b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/launching/GdbLaunch.java
index e072dd4c4d..05b72a84b8 100644
--- a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/launching/GdbLaunch.java
+++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/launching/GdbLaunch.java
@@ -345,6 +345,15 @@ public class GdbLaunch extends DsfLaunch implements ITracedLaunch, ITargetedLaun
handler.execute(req);
}
+ @Override
+ public boolean isTerminated() {
+ // This test matches the last step in shutdownSession
+ if (fTracker != null) {
+ return false;
+ }
+ return super.isTerminated();
+ }
+
// IDisconnect
///////////////////////////////////////////////////////////////////////////
PS We have a slight testing problem because some DSF tests are not working on GitHub actions, see #816 |
I can't reproduce what you are seeing in this case. Let me run down what I see and perhaps we can see where the difference is.
Does that help identify the problem? |
Actually, Terminate and relaunch button action is working fine.
So, Is there any other solution like new launch wait till the termination activities of the previous launch completes? |
comments/questions so we can progress this further:
IIUC the executor is still running but the UI is showing as terminated? Are all nodes shown as terminated, or just the gdb one. In particular is the root shown as terminated like this:
This message comes from embed-cdt (line here). I think it would be possible to add more logic to that code to actually delay the launch, or do a relaunch rather than erroring out. Please raise an issue on the embed-cdt project and tag me (I am a committer on both, but we need to involve the rest of the embed-cdt community as there may be some other inputs there) |
Describe the bug
When a launch is terminated and relaunch it (or any other launch) too fast, executor of previous launch will get shutdown before shutdown sequence is completed and therefore not firing the shutdown function of services.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
When a launch is terminated and relaunch again, terminated launch should get enough time to fire shutdown activities of all the registered services,
Version Information (please complete the following information):
The text was updated successfully, but these errors were encountered: