run_alarms can block a program

Vincent Bernat <[email protected]>
Newsgroups gmane.network.net-snmp.user
Message-ID <[email protected]>
Hi!

I am using snmp_select_info() + select() + run_alarms() +
netsnmp_check_outstanding_agent_requests() in a program acting as a
subagent. It is important for me to avoid any blocking since the program
should be able to send a packet every second. It appears that run_alarms()
can block. I have attached a ltrace output at the end of this mail.

I don't use alarms. I don't use cache. Therefore, I have looked where an
alarm could be registered. It seems that the only possibility is to
register agentx_check_session() and agentx_reopen_session(). In
agentx_check_session(), there is a call to agentx_send_ping().
agentx_send_ping() will in turn call agentx_synch_response() which can
block and sometimes block.

Shouldn't agentx_send_ping() do its work asynchronously? Is there a way to
mitigate this default without disabling AgentX ping? Can I keep the
possibility to reopen the session (with a short timeout) without AgentX
ping?

12046 17:35:09.788068    snmp_select_info(0xbf83b810, 0xbf83b778,
0xbf83b800, 0xbf83b814, 360746 <unfinished ...>
12046 17:35:09.788125       SYS_gettimeofday(0xbf83b544, 0, 0xb7d61474,
0x80713e0, 0xbf83b5dc) = 0
12046 17:35:09.788177       SYS_gettimeofday(0xbf83b5e4, 0, 0xb7d61474, 0,
0) = 0
12046 17:35:09.788240    <... snmp_select_info resumed> )                  
= 3
12046 17:35:09.788265    select(1024, 0xbf83b778, 0xbf83b6f8, 0xbf83b678,
0xbf83b808 <unfinished ...>
12046 17:35:09.788374       SYS__newselect(1024, 0xbf83b778, 0xbf83b6f8,
0xbf83b678, 0xbf83b808) = 0
12046 17:35:10.545848    <... select resumed> )                            
= 0
12046 17:35:10.545883    __errno_location()                                
= 0xb79958c0
12046 17:35:10.545960    snmp_timeout(1024, 0xbf83b778, 0xbf83b6f8,
0xbf83b678, 0xbf83b808 <unfinished ...>
12046 17:35:10.546015       SYS_gettimeofday(0xbf83b5e4, 0, 0xb7d61474,
0x8071548, 0x8071560) = 0
12046 17:35:10.546068       SYS_gettimeofday(0xbf83b5e4, 0, 0xb7d61474,
0x8071028, 0x8071040) = 0
12046 17:35:10.546120       SYS_gettimeofday(0xbf83b5e4, 0, 0xb7d61474,
0x806fda0, 0x806fcd0) = 0
12046 17:35:10.546180    <... snmp_timeout resumed> )                      
= 0
12046 17:35:10.546226    __errno_location()                                
= 0xb79958c0
12046 17:35:10.546297    gettimeofday(0xbf83b5e4, NULL <unfinished ...>
12046 17:35:10.546348       SYS_gettimeofday(0xbf83b5e4, 0, 0xb79958c0, 0,
0x806df20) = 0
12046 17:35:10.546406    <... gettimeofday resumed> )                      
= 0
12046 17:35:10.546451    run_alarms(0x806e044, 119333, 0x4bab90bc, 935756,
0xbf83b808 <unfinished ...>
12046 17:35:10.546507       SYS_gettimeofday(0xbf83b604, 0, 0xb7d61474, 0,
0x80713e0) = 0
12046 17:35:10.546578       SYS_socketcall(9, 0xbf83b2e0, 0xb7d61474,
0x8091748, 0x8071220) = 20
12046 17:35:10.546634       SYS_gettimeofday(0xbf83b3f4, 0, 0xb7d61474,
0x80916e0, 0x8071078) = 0
12046 17:35:10.546713       SYS_gettimeofday(0xbf83b384, 0, 0xb7d61474,
0x80713e0, 0xbf83b41c) = 0
12046 17:35:10.546765       SYS_gettimeofday(0xbf83b424, 0, 0xb7d61474, 0,
0) = 0
12046 17:35:10.546817       SYS__newselect(13, 0xbf83b47c, 0, 0,
0xbf83b50c) = 0
[...]
12046 17:35:13.456029       SYS__newselect(13, 0xbf83b47c, 0, 0,
0xbf83b50c) = 0
12046 17:35:13.465777       SYS_gettimeofday(0xbf83b424, 0, 0xb7d61474,
0x8071548, 0x8071560) = 0
12046 17:35:13.465839       SYS_gettimeofday(0xbf83b424, 0, 0xb7d61474,
0x8071028, 0x8071040) = 0
12046 17:35:13.465890       SYS_gettimeofday(0xbf83b424, 0, 0xb7d61474,
0x806fda0, 0x806fcd0) = 0
12046 17:35:13.465943       SYS_gettimeofday(0xbf83b384, 0, 0xb7d61474,
0x80713e0, 0xbf83b41c) = 0
12046 17:35:13.465994       SYS_gettimeofday(0xbf83b424, 0, 0xb7d61474, 0,
0) = 0
12046 17:35:13.466045       SYS__newselect(13, 0xbf83b47c, 0, 0,
0xbf83b50c) = 0
12046 17:35:13.475766       SYS_gettimeofday(0xbf83b424, 0, 0xb7d61474,
0x8071548, 0x8071560) = 0
12046 17:35:13.475831       SYS_gettimeofday(0xbf83b424, 0, 0xb7d61474,
0x8071028, 0x8071040) = 0
12046 17:35:13.475887       SYS_gettimeofday(0xbf83b424, 0, 0xb7d61474,
0x806fda0, 0x806fcd0) = 0
12046 17:35:13.475940       SYS_gettimeofday(0xbf83b384, 0, 0xb7d61474,
0x80713e0, 0xbf83b41c) = 0
12046 17:35:13.476004       SYS_gettimeofday(0xbf83b424, 0, 0xb7d61474, 0,
0) = 0
12046 17:35:13.476060       SYS__newselect(13, 0xbf83b47c, 0, 0,
0xbf83b50c) = 1
12046 17:35:13.484256       SYS_socketcall(6, 0xbf83b210, 0xb7d61474,
0x8091988, 0x8071220) = 0
12046 17:35:13.484312       SYS_socketcall(10, 0xbf83b210, 0xb7d61474,
0x8091988, 0x8071220) = 84
12046 17:35:13.484381       SYS_gettimeofday(0xbf83afb4, 0, 0xb7ddc2d4, 1,
0) = 0
12046 17:35:13.484447       SYS_gettimeofday(0xbf83b604, 0, 0xb7d61474, 0,
0x80713e0) = 0
12046 17:35:13.484516    <... run_alarms resumed> )                        
= 0x4bab90c1
12046 17:35:13.484544   
netsnmp_check_outstanding_agent_requests(0x806e044, 119333, 0x4bab90bc,
935756, 0xbf83b808) = 0xb7ddcd48


------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
Net-snmp-users mailing list
[email protected]
Please see the following page to unsubscribe or change other options:
https://lists.sourceforge.net/lists/listinfo/net-snmp-users
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.