svina...@gmail.com
unread,May 19, 2013, 1:58:41 PM5/19/13You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to
Hi
I am using expect version 5.40 (/bin/expect -version ) and I am encountering a very random issue (reproducibility 1 in 20).
Issue is: timeout is not getting triggered when flood of messages is received.
Code snippet as follows
======================================
exp_internal 1
set TimeoutTick 0
set timeout 1
send " \r"
expect {
"(none)" {
**** do something ****
exp_continue
}
-re "Bad Magic Number\r\nar7240>" {
**** do something ****
return
}
-re "ar7240>" {
**** do something ****
exp_continue }
-re "\n~ # " {
**** do something ****
return
}
timeout {
puts "In time-out"
if { $TimeoutTick < $TimeOutLimit} {
**** take action for couple of retrie****
exp_continue
} else {
puts "Giving up"
exp_internal 0
}
}
============================================
In order to debug the issue, I set "exp_internal 1" in the function and clear the debug log "exp_internal 0" when it exits.
Log when issue is observed as follows
******************************
kernel: "ar7240>"? no^M
kernel: "\n~ # "? no^M
kernel: expect: timed out^M
kernel: In time-out^M
kernel: send: sending " \r" to { exp4 }^M
kernel: expect: continuing expect^M
kernel: ^M
kernel: expect: does " Mb/s; 9 Mb/s; 12 Mb/s; 18 Mb/s; 24 Mb/s\r\n
................
.............
[ NOTE ] around 200 - 300 Kbs of data
............
...............
kernel: "Bad Magic Number\r\nar7240>"? no^M
kernel: "ar7240>"? no^M
kernel: "\n~ # "? no^M
[NOTE ] <------TIMEOUT not getting triggered?------------------->
kernel: expect: set expect_out(spawn_id) "exp4"^M
kernel: expect: set expect_out(buffer) "Mb/s\r\n
................
.............
[ NOTE ] around 200 - 300 Kbs of data
............
******************************
As this issue is very random, seen when logs of data is in expect buffer , the question is, why timeout not getting triggered (incorporated in NOTES section between logs?
Any suggestion or help will be greatly appreciated.
Any *Conditions* for time out to get triggered?
Thanks in advance.
Vinayak