freehandvn / gtalksms

Automatically exported from code.google.com/p/gtalksms
0 stars 0 forks source link

cmd command can hang app #31

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. use "cmd:logcat" (or any other command that doesn't immediately terminate)

What is the expected output? What do you see instead?
Ideally, expect 2 things:
* logcat lines are printed as they become available
* gtalksms continues to work as normal

Instead, I see:
* gtalksms appears to be hung and no longer responds to commands.  Debugger 
tells me it is blocking to read the process output.

Original issue reported on code.google.com by skippy.hammond@gmail.com on 6 Jan 2011 at 12:13

GoogleCodeExporter commented 9 years ago
Once the 'chat room' feature lands, it might make sense to leverage that for 
this - something like:

* Each new cmd request executes in its own thread.
* A new chat room is opened for the command.
* Things sent to this chatroom by the user are send to stdin on the process.
* Things send to stdout get sent to this room by the app.

Probably also need some way of killing the process - so we probably want to 
assign a 'unique id' to each cmd started (possibly just the PID, although that 
isn't very friendly), and have a global command with the format 'kill:some_id' 
to kill it.

Original comment by skippy.hammond@gmail.com on 6 Jan 2011 at 11:47

GoogleCodeExporter commented 9 years ago
I noticed the same bug on "cmd:top".

I also noticed it doesnt work very well with huge results, try a "cmd:ps" for 
example and you won't get everything usually answered by the terminal.

Furthermore, be aware that "kill:some_id" is likely to fail on 2.2+ terminal 
because of the way froyo limits this kind of actions ...

Original comment by yoanjacq...@gmail.com on 10 Jan 2011 at 9:38

GoogleCodeExporter commented 9 years ago
I've made a first fix to manage infinite commands.
I've some issue to kill the thread (ie the command) because thread.stop is not 
precated and throw an exception.

Then if you send command like "top" don't forget to send another command like 
"killall top"

Original comment by Florent....@gmail.com on 26 Jan 2011 at 12:11

GoogleCodeExporter commented 9 years ago

Original comment by Florent....@gmail.com on 29 Jan 2011 at 7:03

GoogleCodeExporter commented 9 years ago
Fixed in v1.8

Original comment by Florent....@gmail.com on 29 Jan 2011 at 10:57

GoogleCodeExporter commented 9 years ago

Original comment by fschm...@gmail.com on 25 Aug 2011 at 7:51