-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Live salt-master Profiling with SIGUSR2 fails #24276
Comments
If you look in the master logs, were there any exceptions? I've used this feature a few times and haven't had issues with it. |
I started the salt-master in the foreground with I issued On the screen I instantly got
One salt-master process turned into a zombie I stopped the salt-master service And started the salt-master service |
poller.poll ends up calling the poll system call under the hood. If the process which called poll() gets a signal it will raise `ZMQError: Interrupted system call` which we should catch and move continue.
Relatively easy fix (#24405). Basically that process that threw the backtrace was the reactor. That process sits and watches the event but and then reacts to those events. The problem was that the call to poll() wasn't within the try/except block, meaning that if it got a signal while calling poll() it would throw this exception (which for a relatively quiet master-- this is where it will spend all of its time). Generally speaking I'd suggest being more specific with the SIGUSR2 (catching the process you intend) unless the goal is to get all of the profiling data-- which this will do. In case you didn't know if you install python-setproctitle it will actually set the name (in ps) for each salt-master process to what it actually does. |
Nice catch, @jacksontj ! |
@markuskramerIgitt, close this issue if you think @jacksontj's fix solved your problem, thanks. |
Hello @jacksontj, Thank you also for your suggestion to send SIGUSR2 only to one process. Thank you a third time for pointing to setproctitle, which I never heard of. Are these the correct steps for installation on Debian? Do I have to configure something?
|
Hello @jfindlay |
@markuskramerIgitt, the next release will be 2015.5.3, which will come out in about a month. |
@markuskramerIgitt Do you consider this issue resolved, now that 2015.5.3 (and 2015.5.5) have been released? Or does more work need to be done here? |
Hi @rallytime, thank you for the reminder. I reread https://docs.saltstack.com/en/latest/topics/troubleshooting/master.html#live-salt-master-profiling Running a background salt-master Running a foreground salt-master by issuing
|
Thanks for the update @markuskramerIgitt. I'll remove the @jacksontj or @cachedout: just an FYI ping on this one. |
Hello @rallytime, I would gladly verify the fix - I just don't find the yappi output and I don't know how to look for it. Btw, I installed setproctitle on Debian with:
resulting in this htop output:
|
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. If this issue is closed prematurely, please leave a comment and we will gladly reopen the issue. |
How do I find the profiling result, please? When the salt-master runs in the foreground and receives
There is no file under /tmp. salt --versions-report Dependency Versions: System Versions: |
@jacksontj , how did you find the profile results? |
@rallytime could you please reopen this issue? Thank you |
@rallytime , @gtmanfred or @SaltStackSupport could you please reopen this issue and kindly advise how to find the profiler result? Thank you Instead the location of the profiler result,
|
@markuskramerIgitt neither @rallytime nor I work for Saltstack anymore. @saltstack/team-core can you take a look at this? |
Oh - all the best and thank you for your time to both of you!
…On Wed, Jun 12, 2019 at 6:17 PM Daniel Wallace ***@***.***> wrote:
@markuskramerIgitt <https://github.com/markuskramerIgitt> neither
@rallytime <https://github.com/rallytime> nor I work for Saltstack
anymore.
@saltstack/team-core <https://github.com/orgs/saltstack/teams/team-core>
can you take a look at this?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#24276?email_source=notifications&email_token=ACAYREYHCZAU6LTOVZCXQ4DP2EOQNA5CNFSM4BGGC5B2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODXQ7E7I#issuecomment-501346941>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ACAYRE2O5LF2TPPZG657ZGTP2EOQNANCNFSM4BGGC5BQ>
.
|
Thank you for updating this issue. It is no longer marked as stale. |
@markuskramerIgitt I'll take a look at this |
@markuskramerIgitt it looks like stderr for the master process has to be attached to a tty. Make sure you have
In one terminal, and then in the other:
What you should then see in your other terminal window is something like this: [root@c0ff859c66ab salt]# salt-master I'm going to go ahead and close this under the assumption that this will work for you - but if it doesn't, please let me know and I'll reopen. |
Thank you, @waynew |
https://docs.saltstack.com/en/latest/topics/troubleshooting/master.html#live-python-debug-output It appears to be:
...
...
I'm not sure how that could be improved 🤷♂ |
@waynew by "this" I meant your comment "Make sure you have yappi installed." and the pull request above, which I assumed you noticed, has been accepted: https://github.com/saltstack/salt/pull/53481/files |
Ah, I see. Yeah, that makes sense. 👍 |
According to http://docs.saltstack.com/en/latest/topics/troubleshooting/master.html#live-salt-master-profiling
killall -SIGUSR2 salt-master
should turn on profiling.
Instead, the command turnes salt-master into a zombie process.
The text was updated successfully, but these errors were encountered: