You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@trafficserver.apache.org by 오재경 <ja...@nimbusnetworks.co.kr> on 2012/11/14 13:00:40 UTC

sigaction in plugin.

Hi. every one.

I made a purge plugin. it creates and maintains hash memory to manage
already purged objects.

To keep hash memory slim I create a thread which clean expired objects
periodically. At first I used sigaction and SIGALRM but sometimes traffic
server gets hang-up.

The log pattern showed if traffic manager signal ‘10009’ and my signal
happens almost at the same time traffic server stops and doing nothing for
a couple of minutes. After a while traffic server forced to shutdown and
restart.

Now I don’t use signal in my plugin. but I wonder why I can’t use signal?
and How can I avoid it even when I use signal?

Thanks…

Success, it REALLY is a mind game.



Re: sigaction in plugin.

Posted by Brian Geffon <br...@apache.org>.
This might be a silly suggestion, but what would be wrong with just
creating a thread and usleeping it in a loop?


On Thu, Nov 15, 2012 at 10:31 AM, James Peach <jp...@apache.org> wrote:
> On 14/11/2012, at 4:00 AM, 오재경 <ja...@nimbusnetworks.co.kr> wrote:
>
>> Hi. every one.
>>
>> I made a purge plugin. it creates and maintains hash memory to manage already purged objects.
>>
>> To keep hash memory slim I create a thread which clean expired objects periodically. At first I used sigaction and SIGALRM but sometimes traffic server gets hang-up.
>
> Yeh, that's not really going to work. You would have to guarantee that nothing else in the process is going to use SIGALRM (which you can't do).
>
>> The log pattern showed if traffic manager signal ‘10009’ and my signal happens almost at the same time traffic server stops and doing nothing for a couple of minutes. After a while traffic server forced to shutdown and restart.
>>
>> Now I don’t use signal in my plugin. but I wonder why I can’t use signal? and How can I avoid it even when I use signal?
>
> It sounds like you should be able to use TSContScheduleEvery(). If you can't do that for some reason, then you should use a mechanism that lets you safely handle the signal; kevent on *BSD, probably signalfd on Linux.
>
> J
>

Re: sigaction in plugin.

Posted by James Peach <jp...@apache.org>.
On 14/11/2012, at 4:00 AM, 오재경 <ja...@nimbusnetworks.co.kr> wrote:

> Hi. every one.
> 
> I made a purge plugin. it creates and maintains hash memory to manage already purged objects.
> 
> To keep hash memory slim I create a thread which clean expired objects periodically. At first I used sigaction and SIGALRM but sometimes traffic server gets hang-up.

Yeh, that's not really going to work. You would have to guarantee that nothing else in the process is going to use SIGALRM (which you can't do).

> The log pattern showed if traffic manager signal ‘10009’ and my signal happens almost at the same time traffic server stops and doing nothing for a couple of minutes. After a while traffic server forced to shutdown and restart.
> 
> Now I don’t use signal in my plugin. but I wonder why I can’t use signal? and How can I avoid it even when I use signal?

It sounds like you should be able to use TSContScheduleEvery(). If you can't do that for some reason, then you should use a mechanism that lets you safely handle the signal; kevent on *BSD, probably signalfd on Linux.

J