[asterisk-bugs] [JIRA] (ASTERISK-19867) asterisk fails to lower its priority when astcanary dies

Walter Doekes (JIRA) noreply at issues.asterisk.org
Fri Sep 16 08:45:01 CDT 2016


    [ https://issues.asterisk.org/jira/browse/ASTERISK-19867?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=232323#comment-232323 ] 

Walter Doekes commented on ASTERISK-19867:
------------------------------------------

Same happens over here.

The canary detection takes quite some time too..

{noformat}
# asterisk -V
Asterisk 11.23.1-osso1~jessie

# chrt -p $(pidof asterisk)
pid 16560's current scheduling policy: SCHED_RR
pid 16560's current scheduling priority: 10

# date; pkill astcanary
Fri Sep 16 15:39:58 CEST 2016

# tail -n1 /var/log/asterisk/messages.log
[Sep 16 15:41:38] WARNING[16566] asterisk.c: The canary is no more.  He has ceased to be!  He's expired and gone to meet his maker!  He's a stiff!  Bereft of life, he rests in peace.  His metabolic processes are now history!  He's off the twig!  He's kicked the bucket.  He's shuffled off his mortal coil, run down the curtain, and joined the bleeding choir invisible!!  THIS is an EX-CANARY.  (Reducing priority)

# date; chrt -p $(pidof asterisk)
Fri Sep 16 15:42:20 CEST 2016
pid 16560's current scheduling policy: SCHED_RR
pid 16560's current scheduling priority: 10
{noformat}

Note that I'm running as user asterisk, so that may affect how easily the process can switch priority..

> asterisk fails to lower its priority when astcanary dies
> --------------------------------------------------------
>
>                 Key: ASTERISK-19867
>                 URL: https://issues.asterisk.org/jira/browse/ASTERISK-19867
>             Project: Asterisk
>          Issue Type: Bug
>      Security Level: None
>          Components: Utilities/astcanary
>    Affects Versions: 1.8.7.2, 1.8.11.1, 1.8.12.0
>         Environment: Debian GNU/Linux 6 (squeeze)
> Linux 2.6.32-5-686 and 2.6.32-5-686-bigmem
> GNU libc 2.11
>            Reporter: Xavier Hienne
>
> When astcanary dies, asterisk is supposed to lower its priority and return to the SCHED_OTHER scheduling policy.
> This is not what I'm observing on Linux: apparently, the death of astcanary is detected by the watching thread, but it fails to change the priority of all other asterisk threads. I suspect that only the watching thread sees its priority changed (just before dying) and this might be the expected behavior of sched_setscheduler() with pid=0.
> Here is how to reproduce this issue:
> $ ps u $(pidof astcanary asterisk)
> USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
> root     31854  6.8  3.3  34732 17120 ?        Ssl  15:59   0:00 /usr/sbin/asterisk -p -M 1000
> root     31855  0.0  0.1   2892   772 ?        S    15:59   0:00 astcanary /var/run/asterisk/alt.asterisk.canary.tweet.tweet.tweet 31854
> $ chrt -p $(pidof asterisk)
> pid 31854's current scheduling policy: SCHED_RR
> pid 31854's current scheduling priority: 10
> $ killall astcanary 
> (after some time => WARNING[31856] asterisk.c: The canary is no more...)
> $ chrt -p $(pidof asterisk)
> pid 31854's current scheduling policy: SCHED_RR
> pid 31854's current scheduling priority: 10
> => asterisk is still at its highest priority



--
This message was sent by Atlassian JIRA
(v6.2#6252)



More information about the asterisk-bugs mailing list