[Idle-dev] socket troubles

baecker@physik.tu-dresden.de baecker@physik.tu-dresden.de
Fri, 28 Feb 2003 14:11:15 +0100 (CET)


Hi,

I have a question (which in the end is related to the socket associated
with idle):
Is it right that at the moment it is not possible to have
two instances of idle running on the same machine by different users
(or even the same user ) ?

If so, are there any plans/possibility to improve on this ?
((I browsed through the archive of the mailing list and
this topic was raised a while ago, but I haven't found a solution on
this..)

I just did another test on this and the results/"screen-shots" are
at the end of this message.

Background information:
  We are planning to use Idle in a course on computational physics.
  The tutorials will be done in a PC-Pool which
  is also accessible via the internet.

  There seems to be another issue arising from this:
  under certain circumstances we encounter that idle gets killed
  but not completely. Then the socket is not freed for further use.
  So the same user will not be able to start idle again.
  (and in general he will not know which process to kill ...).

  Now, even worse, it could be that this user just logs out from the
machine
  and goes home. Then another user will not be able to use idle.
  Now only a root user (well, or the previous user) can solve this
problem, or ?

  I think that this is really a substantial problem for using
  idle in a multi-user environment.

Don't get me wrong, I think idle is really good, in particular for
beginners!!!

Many thanks,

Arnd


Illustration of the problem:
============================

On machine test one user runs idle.
Now I ssh to this machine and try to start idle.
This is what happens:



-------------- begin screen-shot --------------------
[test] ~ $ idle
.  .  .
Idle socket error: Address already in use, retrying...

Idle socket error: Address already in use, retrying...

[[At this point  I press CTRL-c]]

Traceback (most recent call last):
  File "/home/python/PYTHON/bin//idle", line 11, in ?
    idlelib.PyShell.main()
  File
"/home/python/PYTHON/lib/python2.2/site-packages/idlelib/PyShell.py", line
1238, in main
    flist.pyshell = PyShell(flist)
  File
"/home/python/PYTHON/lib/python2.2/site-packages/idlelib/PyShell.py", line
716, in __init__
    self.interp.start_subprocess()
  File
"/home/python/PYTHON/lib/python2.2/site-packages/idlelib/PyShell.py", line
338, in start_subprocess
    time.sleep(i)
KeyboardInterrupt
[ptpcp4] ~ $ exit
-------------- end screen-shot --------------------

Even worse, doing a CTRL-c after realising
the problem and tyring to log out, ssh waits.
The reason is that a process is still alive - ps fax (from a different
terminal) gives:

 4768 pts/2    S      0:05  |   |   \_ /home/python/PYTHON/bin/python
/home/python/PYTHON/bin//idle
 4836 pts/2    S      0:00  |   |       \_ /home/python/PYTHON/bin/python
-c __import__('idlelib.run').run.main() 8833
 4870 ?        S      0:00 /home/python/PYTHON/bin/python -c
__import__('idlelib.run').run.main() 8833

Killing the last (from a different window) allows ssh to quit the
connection. (the first two processes are from the other user ...)