Project

General

Profile

Scénario #6022

La commande manage_station.py ne rend pas la main en cas de timeout

Added by Damien THOMAS over 7 years ago. Updated over 5 years ago.

Status:
Terminé (Sprint)
Priority:
Normal
Assigned To:
-
Category:
-
Start date:
11/13/2015
Due date:
11/20/2015
% Done:

100%

Estimated time:
(Total: 1.00 h)
Spent time:
0.08 h (Total: 0.58 h)
Story points:
2.0
Remaining (hours):
0.00 hour
Velocity based estimate:
Release:
Release relationship:
Auto

Description

Bonjour,

EAD plante quand j'arrête les postes si j'ai ouvert une session administrateur local dessus à distance et que je l'intègre au domaine.

Si je me rend dans EAD pour éteindre les postes

outils -> machines

systématiquement EAD plante sur une requête trop longue


Subtasks

Tâche #14006: Arrêter le reactor en cas de timeoutFerméDaniel Dehennin


Related issues

Related to Distribution EOLE - Tâche #13839: Étude demande 6022 Plantage EAD Fermé 11/02/2015
Related to controle-vnc - Tâche #14089: Le service controle-vnc s'arrête lors de la connexion d'un utilisateur (EOLE 2.5.2) Fermé 11/19/2015

History

#1 Updated by Joël Cuissinat over 7 years ago

  • Status changed from Nouveau to A étudier
  • Target version set to Mises à jour 2.3.11

Rien dans /var/log/ead/ead-server par hasard ?

#2 Updated by Joël Cuissinat over 7 years ago

  • Target version changed from Mises à jour 2.3.11 to Mises à jour 2.3.12

#3 Updated by Fabrice Barconnière about 7 years ago

  • Target version changed from Mises à jour 2.3.12 to Mises à jour 2.3.13

#4 Updated by Joël Cuissinat almost 7 years ago

  • Target version deleted (Mises à jour 2.3.13)

#5 Updated by Emmanuel GARETTE over 5 years ago

<gnunux> ddtddt|2, donc je suis sur la machine A, je lance mstsc.exe sur la machine B, je vais dans l'EAD et j'étais la machine A c'est ca ?
<ddtddt|2> non
<ddtddt|2> je suis sur A
<ddtddt|2> je me connecte en admin à distance sur B avec mstsc.exe
<ddtddt|2> je me déconecte de B
<ddtddt|2> je lance EAD
<ddtddt|2> j'essais d'éteindre B
<ddtddt|2> B ne s"étteind pas et l'interface plante

#6 Updated by Emmanuel GARETTE over 5 years ago

  • Status changed from A étudier to Nouveau

J'ai reproduit sur XP.

Si je lance à la main :

root@amonecole:~# /usr/bin/ssh -q -o LogLevel=ERROR -o StrictHostKeyChecking=no root@192.0.2.52 /usr/share/eole/controlevnc/manage_stations.py -s 10.3.2.54 -t 0
"Erreur , Traceback (failure with no frames): <class 'cliscribe.TimeoutError'>: Callback timed out\n" 
Unhandled Error
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/twisted/internet/defer.py", line 287, in addCallbacks
    self._runCallbacks()
  File "/usr/lib/python2.7/dist-packages/twisted/internet/defer.py", line 545, in _runCallbacks
    current.result = callback(current.result, *args, **kw)
  File "/usr/lib/python2.7/dist-packages/twisted/internet/base.py", line 426, in _continueFiring
    callable(*args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/twisted/internet/base.py", line 621, in disconnectAll
    failure.Failure(main.CONNECTION_LOST))
--- <exception caught here> ---
  File "/usr/lib/python2.7/dist-packages/twisted/python/log.py", line 84, in callWithLogger
    return callWithContext({"system": lp}, func, *args, **kw)
  File "/usr/lib/python2.7/dist-packages/twisted/python/log.py", line 69, in callWithContext
    return context.call({ILogContext: newCtx}, func, *args, **kw)
  File "/usr/lib/python2.7/dist-packages/twisted/python/context.py", line 118, in callWithContext
    return self.currentContext().callWithContext(ctx, func, *args, **kw)
  File "/usr/lib/python2.7/dist-packages/twisted/python/context.py", line 81, in callWithContext
    return func(*args,**kw)
  File "/usr/lib/python2.7/dist-packages/twisted/internet/tcp.py", line 434, in connectionLost
    self.connector.connectionLost(reason)
  File "/usr/lib/python2.7/dist-packages/twisted/internet/base.py", line 1063, in connectionLost
    self.factory.clientConnectionLost(self, reason)
  File "/usr/lib/python2.7/dist-packages/twisted/spread/pb.py", line 1146, in clientConnectionLost
    self._failAll(reason)
  File "/usr/lib/python2.7/dist-packages/twisted/spread/pb.py", line 1133, in _failAll
    d.errback(reason)
  File "/usr/lib/python2.7/dist-packages/twisted/internet/defer.py", line 391, in errback
    self._startRunCallbacks(fail)
  File "/usr/lib/python2.7/dist-packages/twisted/internet/defer.py", line 451, in _startRunCallbacks
    raise AlreadyCalledError
twisted.internet.defer.AlreadyCalledError: 
Extinction de 10.3.2.54

Dans l'EAD cela n'a pas l'air de s'arrêter :

root@amonecole:~# ps auxf|grep manage_st
root     31968  0.0  0.0   9424   900 pts/0    S+   17:30   0:00          \_ grep --color=auto manage_st
root     31281  0.0  0.6 196792 20300 ?        Ssl  17:23   0:00      |       \_ python /usr/share/eole/controlevnc/manage_stations.py -s 10.3.2.54 -t 0
root     31268  0.0  0.0  41524  2796 ?        S    17:23   0:00  \_ /usr/bin/ssh -q -o LogLevel=ERROR -o StrictHostKeyChecking=no root@192.0.2.52 /usr/share/eole/controlevnc/manage_stations.py -s 10.3.2.54 -t 0
root@amonecole:~# date
jeudi 22 octobre 2015, 17:32:18 (UTC+0200)

En python ca s'arrête bien aussi :

root@amonecole:/usr/share/ead2# python
Python 2.7.3 (default, Jun 22 2015, 19:33:41) 
[GCC 4.6.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from pyeole.process import system_out
>>> get_client_scribe_script = "/usr/share/eole/controlevnc/manage_stations.py" 
>>> user = '10.3.2.54'
>>> a, b, err = system_out([get_client_scribe_script, '-s', user, '-t', '0'], container='fichier')
>>> print a
0
>>> print b
Extinction de 10.3.2.54

>>> print err
"Erreur , Traceback (failure with no frames): <class 'cliscribe.TimeoutError'>: Callback timed out\n" 
Unhandled Error
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/twisted/internet/defer.py", line 287, in addCallbacks
    self._runCallbacks()
  File "/usr/lib/python2.7/dist-packages/twisted/internet/defer.py", line 545, in _runCallbacks
    current.result = callback(current.result, *args, **kw)
  File "/usr/lib/python2.7/dist-packages/twisted/internet/base.py", line 426, in _continueFiring
    callable(*args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/twisted/internet/base.py", line 621, in disconnectAll
    failure.Failure(main.CONNECTION_LOST))
--- <exception caught here> ---
  File "/usr/lib/python2.7/dist-packages/twisted/python/log.py", line 84, in callWithLogger
    return callWithContext({"system": lp}, func, *args, **kw)
  File "/usr/lib/python2.7/dist-packages/twisted/python/log.py", line 69, in callWithContext
    return context.call({ILogContext: newCtx}, func, *args, **kw)
  File "/usr/lib/python2.7/dist-packages/twisted/python/context.py", line 118, in callWithContext
    return self.currentContext().callWithContext(ctx, func, *args, **kw)
  File "/usr/lib/python2.7/dist-packages/twisted/python/context.py", line 81, in callWithContext
    return func(*args,**kw)
  File "/usr/lib/python2.7/dist-packages/twisted/internet/tcp.py", line 434, in connectionLost
    self.connector.connectionLost(reason)
  File "/usr/lib/python2.7/dist-packages/twisted/internet/base.py", line 1063, in connectionLost
    self.factory.clientConnectionLost(self, reason)
  File "/usr/lib/python2.7/dist-packages/twisted/spread/pb.py", line 1146, in clientConnectionLost
    self._failAll(reason)
  File "/usr/lib/python2.7/dist-packages/twisted/spread/pb.py", line 1133, in _failAll
    d.errback(reason)
  File "/usr/lib/python2.7/dist-packages/twisted/internet/defer.py", line 391, in errback
    self._startRunCallbacks(fail)
  File "/usr/lib/python2.7/dist-packages/twisted/internet/defer.py", line 451, in _startRunCallbacks
    raise AlreadyCalledError
twisted.internet.defer.AlreadyCalledError: 

>>> 

#7 Updated by Emmanuel GARETTE over 5 years ago

  • Tracker changed from Anomalie to Demande

La commande peut mettre trop de temps. Une solution simple serait d'exécuter la commande dans "at".

#8 Updated by Scrum Master over 5 years ago

  • Assigned To set to Emmanuel GARETTE

#9 Updated by Scrum Master over 5 years ago

  • Parent task set to #13757

#10 Updated by Scrum Master over 5 years ago

  • Assigned To deleted (Emmanuel GARETTE)

#11 Updated by Scrum Master over 5 years ago

  • Parent task deleted (#13757)

#12 Updated by Scrum Master over 5 years ago

  • Tracker changed from Tâche to Demande
  • Target version deleted (Sprint 2015 45-47 - Équipe MENESR)

Etude de la demande

#13 Updated by Scrum Master over 5 years ago

  • Assigned To set to developpeurs_eole

#14 Updated by Daniel Dehennin over 5 years ago

Le problème est double :

  • Il n’y a aucune gestion des timeout sur les appels de commande dans ead.
  • La commande manage_station.py ne s’arrête jamais si la commande distante est bloquante

Ce deuxième point n’est pas résolu par la gestion actuelle du timeout, en effet :

Cela conduit a la levée d’exception AlreadyCalledError.

Pour que la commande ne soit plus bloquante, il faut :

  1. Ne plus tester si callback() a bien été appelé sur l’objet Deferred car c’est toujours le cas
  2. Sauvegarder l’exception de timeout dans l’objet ClientScribe et arrêter le reactor sans exécuter les callback() et errback()
  3. Lever l’exception si elle est définie avant de sortir du script

#15 Updated by Daniel Dehennin over 5 years ago

  • Tracker changed from Demande to Scénario
  • Due date set to 11/20/2015
  • Assigned To deleted (developpeurs_eole)
  • Target version set to Sprint 2015 45-47 - Équipe MENESR
  • Start date set to 11/02/2015
  • Release set to EOLE 2.5.2
  • Story points set to 2.0

Passage sur le sprint pour appliquer le commit.

#16 Updated by Daniel Dehennin over 5 years ago

  • Project changed from ead to controle-vnc
  • Subject changed from Plantage de EAD to La commande manage_station.py ne rend pas la main en cas de timeout

#17 Updated by Joël Cuissinat over 5 years ago

  • Status changed from Nouveau to Terminé (Sprint)

Also available in: Atom PDF