Skip to content
This repository has been archived by the owner on Sep 8, 2024. It is now read-only.

Skills and Enclosure background services fail to stop and are killed... #2492

Closed
trekjunky opened this issue Mar 5, 2020 · 10 comments · Fixed by #2538
Closed

Skills and Enclosure background services fail to stop and are killed... #2492

trekjunky opened this issue Mar 5, 2020 · 10 comments · Fixed by #2538

Comments

@trekjunky
Copy link

trekjunky commented Mar 5, 2020

Be clear about the software, hardware and version you are running

For example:

in CLI

what version are you running
I am running mycroft-core version 20 oh 2, release 0
You are on the latest version.

Opensuse Leap 15.1

Try to provide steps that we can use to replicate the Issue

For example:

  1. CTRL+C in CLI
  2. Enter ./stop_mycroft.sh
  3. Skills and Enclosure services are eventually killed.
  4. Takes about 30 seconds total

Be as specific as possible about the expected condition, and the deviation from expected condition.

user@LinuxOS:/mycroft-core> ./stop-mycroft.sh skills
Stopping skills (5579)...stopped.
user@LinuxOS:
/mycroft-core> ./stop-mycroft.sh enclosure
Stopping enclosure (5588)...failed to stop.
Killing enclosure (5588)...killed.
user@LinuxOS:/mycroft-core> ./stop-mycroft.sh
Stopping all mycroft-core services
Stopping messagebus.service (5576)...stopped.
Stopping audio (5582)...stopped.
Stopping speech (5585)...stopped.
...
user@LinuxOS:
/mycroft-core> ./stop-mycroft.sh
Stopping all mycroft-core services
Stopping messagebus.service (18995)...stopped.
Stopping skills (18998)...failed to stop.
Killing skills (18998)...killed.
Stopping audio (19001)...stopped.
Stopping speech (19004)...stopped.
Stopping enclosure (19007)...failed to stop.
Killing enclosure (19007)...killed.
user@LinuxOS:~/mycroft-core>

@andlo
Copy link
Contributor

andlo commented Mar 5, 2020

As I see this - it only kills the skillsservice if it takes to long to stop. The reason for a long stop time could be a bad skill hangs or a skill is dooing something that takes long time when it gets the shutdown command.

I think killing the service is the right to do if it takes to long - I notised that if one is making some bad programming in a skill (i do that all the time) then the skill will not liad, and if it is really bad skillservice will hang ending up wuith mycroft answers "waite until i finish booting up".
And then restarting skillservice hangs until the restart is killing the process.

I have never seen los of data, and have heavily used killing the proces when I worked on injecting debug adaptor.

So I think killing proceses is fine, but first ask nicely as it is alreddy done. but maybe the timeout until killing should be encresed.

@forslund
Copy link
Collaborator

forslund commented Mar 5, 2020

As @andlo says in some cases the killing is valid and I've seen no real harm from it yet but there are potential for harm.

Things that could be improved

  • shutting down during msm install. (this could theoretically cause issues)
  • shutting down while uploading settings meta.
  • shutting down while doing the initial load of skills.

And the enclosure, there's no need for it to be all that busy. It should basically never need to be killed so there's probably a bug there.

@trekjunky
Copy link
Author

Okay, this is what I understand that I need to do. I should wait until the "I'm finished booting up." message pops up BEFORE I shut down the services. I don't remember if that's when I tried to shut down the services. I will report later what happened. Thanks!!!!

@trekjunky
Copy link
Author

I got this message: ">> Hi, this is mycroft and I am ready to work." BUT there was MSM messages still scrolling past so I waited until the messages stopped. Skills and Enclosure both were killed.

@ChanceNCounter
Copy link
Contributor

I've always had this problem with the enclosure service, but only recently started seeing it with skills. I assumed it was because the enclosure isn't fully implemented on Linux (which has no associated hardware, ofc.)

I've just tested on a clean installation, which still needed to kill the skills service. I edited stop-mycroft.sh and upped the timeout to 30 seconds, and the skill service did eventually stop, though I didn't count how long it took.

@trekjunky
Copy link
Author

Thanks @ChanceNCounter . I tried 30 and 60 seconds, both fixed the skills error which took 10 seconds to stop, but the enclosure did not stop after 60 seconds. I will try 120 seconds, but if that doesn't work, I don't know what to do.

@trekjunky
Copy link
Author

120 seconds caused (or maybe my impatience caused) the message bus not to stop even past the 120 second mark and it would not move on to be killed or stopped. I thought I messed something up, so I rebooted the PC and tried again. It did the same thing. I had to CTRL+C on it to move on both times. So I changed the time out to 15 seconds and now it works except for enclosure is killed.

@forslund
Copy link
Collaborator

forslund commented Mar 6, 2020

Thanks for testing @trekjunky, there may be some regression here causing it to lock up during shutdown more than it should. We should definitely investigate more and see what's causing this.

@forslund
Copy link
Collaborator

We've merged #2529 Making the skills stop quicker. The issue with the enclosure has a pending PR (#2538).

Thanks for flagging these issues and making Mycroft better!

@forslund
Copy link
Collaborator

#2538 is now merged so I believe this issue is resolved now. Closing.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants