Ray Van Dolson
2005-Aug-26 14:24 UTC
[Asterisk-Users] Timing issue with call to poll() when running asterisk -rx?
We have a small app that runs asterisk -rx "sip show peers" (etc) and gathers some info and reports it back somewhere else. This is called from a cron job essentially and doesn't really run all that often (once a minute). We noticed some gaps in the results we were getting and dug in a little further. We found that if you run asterisk -rx "sip show peers" from the command line by hand fairly quickly, eventually it will "hang" and wait for a 30-60 seconds or so then finally establish the connection. During this time an strace -p on the process shows: poll( When everything begins working it shows that the entire call is: poll([{fd=3, events=POLLIN, revents=POLLIN}], 1, 100) = 1 Note that this is running strace -p on the process while it's in the hung state. If we run strace asterisk -rx "sip show peers" we cannot reproduce the problem. This leads us to think this is some sort of timing issue. There isn't any backoff code or such in the console connection code is there that would be causing this? I don't think this is the source of the problem in our data gap issue above, but just was curious if anyone else had run across this. Ray
Seemingly Similar Threads
- [libnbd PATCH 2/2] poll: Improve our interface
- Re: [PATCH] lib: command: switch from select() to poll()
- [PATCH] lib: command: switch from select() to poll()
- Re: [PATCH] lib: command: switch from select() to poll()
- sudo issues after upgrading to samba/winbind 4.0.13 on Debian Wheezy