Scott> I have a tcl/tk/scotty program that executes periodic
Scott> asynchronous SNMP Gets for interface status and also has a
Scott> graphical interface to view system information obtained via a
Scott> synchronous SNMP Get. Every so often, it appears that the
Scott> program hangs. I no longer receive responses from the
Scott> asynchronous gets and cannot issue any synchronous gets from
Scott> my Tk GUI.
[snip]
Scott> I use snmp watch on to examine the sending and receiving of
Scott> SNMP requests. When the problem occurs, it looks like all the
Scott> asynchronous requests are first sent, then the synchronous
Scott> request is sent, then the asynchronous responses are received,
Scott> then the synchronous response is received.
Thanks for this nice bug report. There is indeed a problem. The SNMP
implementation can indeed drop reponses for asynchronous requests
while waiting for a response for a synchronous request. The problem
here is that the callbacks for asynchronous requests can't be
evaluated while waiting for a reponse for a synchronous request.
(Doing this would create lots of problems because the callback can
have arbitrary side effects like e.g. destroying the session handle
used by the active synchronous request.)
I thought that dropping some of the responses would not create real
problems because you can loose UDP packets everywhere. However, your
example shows that this decision was a bad one. I first thought that
queuing the callbacks until Tcl enters the idle loop again would be
the solution. I finally found a much simpler one. The trick is to use
a special socket for synchronous requests instead of a single socket
for synchronous and asynchronous requests. This will keep the
responses for asynchronous requests in the UDP buffer and everything
should be fine. I have not yet implemented this solution, but it
should not be too difficult to do. I hope to have this fix in the
next version.
Juergen
-- Juergen Schoenwaelder schoenw@cs.utwente.nl http://www.cs.utwente.nl/~schoenw Computer Science Department, University of Twente, (Fax: +31-53-489-3247) P.O. Box 217, NL-7500 AE Enschede, The Netherlands. (Tel. +31-53-489-3678)-- !! This message is brought to you via the `tkined & scotty' mailing list. !! Please do not reply to this message to unsubscribe. To subscribe or !! unsubscribe, send a mail message to <tkined-request@ibr.cs.tu-bs.de>. !! See http://wwwsnmp.cs.utwente.nl/~schoenw/scotty/ for more information.