From: SourceForge.net <no...@so...> - 2004-03-29 18:43:55
|
Patches item #919122, was opened at 2004-03-18 17:33 Message generated for change (Comment added) made by slif You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=312694&aid=919122&group_id=12694 Category: None Group: None Status: Open Resolution: None Priority: 5 Submitted By: Michael J. Slifcak (slif) Assigned to: Nobody/Anonymous (nobody) Summary: test should allow time for programs to settle Initial Comment: The agent and the trap receiver must perform extensive initialization before they are ready to perform their intended function. [The next statement is true for net-snmp-5.x through version 5.1.1] When the agent is configured as an agentX subagent, it will transact 20 packets (10 send, 10 receive) before it will print the version string. Why then, should the test framework expect to not wait SNMP_SLEEP seconds before looking for that version string ? Apply this patch to wait after starting the agent or the trap receiver, no matter how either is started. ---------------------------------------------------------------------- >Comment By: Michael J. Slifcak (slif) Date: 2004-03-29 13:43 Message: Logged In: YES user_id=88697 patch-test-settle-6 The delay after start is replaced by a more generous repeat cycle in the WAITFOR function. Here the time to wait for expected result is expanded to five times the SNMP_SLEEP setting. For the default of SNMP_SLEEP=1, this creates a five second window during which the agent (or trap receiver) can respond. Fast responders are rewarded by exiting the loop early. Slow responders are given more time to produce the expected result. Given this approach, there is no longer any need to DELAY after starting or stopping a program. Since the NOSLEEP methods are found only in eval_tools.sh, they have been replaced with STARTPROG or STOPPROG, as appropriate. The NOSLEEP methods are removed by this patch, as they are not referenced elsewhere. ---------------------------------------------------------------------- Comment By: Michael J. Slifcak (slif) Date: 2004-03-29 12:52 Message: Logged In: YES user_id=88697 Previous comments from cfmartin do not apply here. patch-test-settle-4 is not platform specific It will repeat the search for WAITFOR''s input string for up to 5 seconds. It works without explicitly testing for output file existence. It does not force a delay for platforms that have agents which respond qucikly. Since WAITFOR is called after starting and stopping programs, the repeating for 5 seconds feature might yield acceptable results on AIX. This theorem is not verified. ---------------------------------------------------------------------- Comment By: ProudlyBrewStarbucks (cfmartin) Date: 2004-03-25 14:19 Message: Logged In: YES user_id=1005866 I see now that the patch was for the RUNTESTS script, which runs successfully without the patch. ---------------------------------------------------------------------- Comment By: ProudlyBrewStarbucks (cfmartin) Date: 2004-03-25 13:31 Message: Logged In: YES user_id=1005866 I just opened 922835 "snmptrapd cannot be started with init". I was wondering if this is related to the problem here that snmptrapd does not have enough time to initialize. The following is an example of what gets written to /var/adm/messages when init tries to start snmptrapd. This problem is also in 5.1.1. Port 1622 is definitely not in use before attempting to start snmptrapd. I have not applied a patch before. Is there some doc on how to go about it? Thanks. Mar 24 17:22:17 dsm-nt-clnt2 syslog[17078]: [ID 702911 daemon.error] pdu failed to be created Mar 24 17:22:17 dsm-nt-clnt2 last message repeated 654 times Mar 24 17:22:18 dsm-nt-clnt2 syslog[17080]: [ID 702911 daemon.error] couldn't open 1622 -- errno 125 ("Address already in use") Mar 24 17:22:18 dsm-nt-clnt2 syslog[17078]: [ID 702911 daemon.error] pdu failed to be created Mar 24 17:22:18 dsm-nt-clnt2 last message repeated 540 times Mar 24 17:22:19 dsm-nt-clnt2 syslog[17082]: [ID 702911 daemon.error] couldn't open 1622 -- errno 125 ("Address already in use") Mar 24 17:22:19 dsm-nt-clnt2 syslog[17078]: [ID 702911 daemon.error] pdu failed to be created Mar 24 17:22:19 dsm-nt-clnt2 last message repeated 528 times Mar 24 17:22:20 dsm-nt-clnt2 syslog[17084]: [ID 702911 daemon.error] couldn't open 1622 -- errno 125 ("Address already in use") Mar 24 17:22:20 dsm-nt-clnt2 syslog[17078]: [ID 702911 daemon.error] pdu failed to be created Mar 24 17:22:20 dsm-nt-clnt2 last message repeated 389 times Mar 24 17:22:20 dsm-nt-clnt2 syslog[17086]: [ID 702911 daemon.error] couldn't open 1622 -- errno 125 ("Address already in use") Mar 24 17:22:20 dsm-nt-clnt2 syslog[17078]: [ID 702911 daemon.error] pdu failed to be created Mar 24 17:22:21 dsm-nt-clnt2 last message repeated 638 times Mar 24 17:22:21 dsm-nt-clnt2 syslog[17088]: [ID 702911 daemon.error] couldn't open 1622 -- errno 125 ("Address already in use") Mar 24 17:22:22 dsm-nt-clnt2 syslog[17078]: [ID 702911 daemon.error] pdu failed to be created Mar 24 17:22:23 dsm-nt-clnt2 last message repeated 1242 times Mar 24 17:22:23 dsm-nt-clnt2 syslog[17090]: [ID 702911 daemon.error] couldn't open 1622 -- errno 125 ("Address already in use") Mar 24 17:22:23 dsm-nt-clnt2 syslog[17078]: [ID 702911 daemon.error] pdu failed to be created Mar 24 17:22:24 dsm-nt-clnt2 last message repeated 310 times Mar 24 17:22:24 dsm-nt-clnt2 syslog[17092]: [ID 702911 daemon.error] couldn't open 1622 -- errno 125 ("Address already in use") Mar 24 17:22:24 dsm-nt-clnt2 syslog[17078]: [ID 702911 daemon.error] pdu failed to be created Mar 24 17:22:25 dsm-nt-clnt2 last message repeated 419 times Mar 24 17:22:25 dsm-nt-clnt2 syslog[17094]: [ID 702911 daemon.error] couldn't open 1622 -- errno 125 ("Address already in use") Mar 24 17:22:25 dsm-nt-clnt2 syslog[17078]: [ID 702911 daemon.error] pdu failed to be created Mar 24 17:22:26 dsm-nt-clnt2 last message repeated 360 times Mar 24 17:22:26 dsm-nt-clnt2 syslog[17096]: [ID 702911 daemon.error] couldn't open 1622 -- errno 125 ("Address already in use") Mar 24 17:22:26 dsm-nt-clnt2 syslog[17078]: [ID 702911 daemon.error] pdu failed to be created Mar 24 17:22:27 dsm-nt-clnt2 last message repeated 556 times Mar 24 17:22:27 dsm-nt-clnt2 syslog[17098]: [ID 702911 daemon.error] couldn't open 1622 -- errno 125 ("Address already in use") Mar 24 17:22:27 dsm-nt-clnt2 syslog[17078]: [ID 702911 daemon.error] pdu failed to be created ---------------------------------------------------------------------- Comment By: Michael J. Slifcak (slif) Date: 2004-03-20 13:34 Message: Logged In: YES user_id=88697 I understand the logic of not sleeping SLEEP seconds for most platforms. That works reliably only when the agent or trap receiver are started so that they exit after having forked and begun initializing themselves as UNIX daemons, before the shell comes through the WAITFOR logic to grep messages in the logfile. On mingw, or with MSVS builds, there is no fork. The agent and trap receiver are started from background (&). But I believe that adding a platform specific sleep would not offer robust execution everywhere, for three reasons: 1. If the logfile did not exist, the grep would fail. 2. If the logfile did not already have the string, the grep would fail. 3. If the agent started as an AgentX subagent, it passes 10 packets to and 10 packets from the master agent before it writes the version string. The grep may fail here as well. I'll concede that the first patch did not perform a globally useful function. If WAITFORNOSLEEP were changed to always wait for 2 seconds, that would force the shell to yield, and may give enough time for the agent to complete its initializations and print its version strings. The second patch does this. ---------------------------------------------------------------------- Comment By: Wes Hardaker (hardaker) Date: 2004-03-19 18:52 Message: Logged In: YES user_id=76242 not applying for 5.1.1. The WAITFOR line should take care of a need ffor sleep. the whole point is that it will wait till the version string line shows up, which is a better way for determining if the agent is truely up than a hard sleep. thoughts? ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=312694&aid=919122&group_id=12694 |