AndroidViewClient icon indicating copy to clipboard operation
AndroidViewClient copied to clipboard

Runaway Timer

Open sk87287 opened this issue 11 years ago • 4 comments

In checkOk of adbclient.py, on line 174 a RuntimeError is raised but the timer is not cancelled. One way to resolve this is to wrap the entire thing in a try-finally putting self.setAlarm(0) in the finally instead of directly after the RuntimeError. Thoughts?

sk87287 avatar Oct 31 '13 20:10 sk87287

Thanks for reporting it. You are right, it has never happened to me but it's a potential error. I'm fixing it using your suggestion.

dtmilano avatar Oct 31 '13 21:10 dtmilano

Awesome! Thanks!

sk87287 avatar Oct 31 '13 23:10 sk87287

I'm working with several processes with adb connections and using adbclient. Method call self.socket.recv(4) from adbclient.py not wrapped by try-finally section and terminate process after timeout without any messages and exceptions. Also, process anyway terminates when timeout expired. Perhaps it would be not bad idea to remove self.setAlarm method which still ingored on Windows.

vsurjaninov avatar Sep 07 '15 06:09 vsurjaninov

I've experienced the exact same issue and I had the alarm disabled. Furthermore you can't implement the signal alarm when wrapping it with multiple threads.

Shawn

在 2015年9月7日,14:18,Vladimir Surjaninov [email protected] 写道:

I'm working with several processes with adb connections and using adbclient. Method call self.socket.recv(4) from adbclient.py not wrapped by try-finally section and terminate process after timeout without any messages and exceptions. Also, process anyway terminates when timeout expired. Perhaps it would be not bad idea to remove self.setAlarm method which still ingored on Windows.

— Reply to this email directly or view it on GitHub.

xinquanking avatar Sep 07 '15 14:09 xinquanking