Summary:ASTERISK-05105: EINTR is not checked on get_input at manager.c after poll, cause manager to disconnect
Reporter:Eldad Ran (eldadran)Labels:
Date Opened:2005-09-18 14:12:22Date Closed:2011-06-07 14:10:05
Versions:Frequency of
Description:File: manager.c.
Function get_input.
Manager disconnect on EINTR error after poll returns -1, while it just should ignore this error.
This was OK, until changed in 0004915, that have fixed another problem.


error log shows:
WARNING[20073]: manager.c:1316 get_input: Select returned error: Interrupted system call
Comments:By: Eldad Ran (eldadran) 2005-09-18 14:13:21

please change category to:  [Core Asterisk] AMI - Manager API

By: Michael Jerris (mikej) 2005-09-24 19:04:56

Are you able to produce a disclaimed patch to resolve this problem?

By: Eldad Ran (eldadran) 2005-09-25 02:21:16

Replacing the code with:
       if (res < 0) {
               if(errno == EINTR)
                       return 0;
               ast_log(LOG_WARNING, "Select returned error: %s\n", strerror(errno));
               return -1;
       } else if (res > 0) {
               res = read(s->fd, s->inbuf + s->inlen, sizeof(s->inbuf) - 1 - s->inlen);
               if (res < 1)
                       return -1;
worked for me, I do not know how to generate a patch, but changing the code directly, worked, after handling 500K calls last week.

By: Mark Spencer (markster) 2005-09-25 13:02:03

Fixed in CVS head (different from suggested patch)

By: Digium Subversion (svnbot) 2008-01-15 15:49:00.000-0600

Repository: asterisk
Revision: 6644

U   trunk/manager.c

r6644 | markster | 2008-01-15 15:49:00 -0600 (Tue, 15 Jan 2008) | 2 lines

Fix manager EINTR issue (bug ASTERISK-5105)