https://dev-eole.ac-dijon.fr/https://dev-eole.ac-dijon.fr/favicon.ico2013-09-20T15:17:14ZEnsemble Ouvert Libre Évolutifcontrole-vnc - Scénario #6022: La commande manage_station.py ne rend pas la main en cas de timeouthttps://dev-eole.ac-dijon.fr/issues/6022?journal_id=223782013-09-20T15:17:14ZJoël Cuissinatjoel.cuissinat@ac-dijon.fr
<ul><li><strong>Statut</strong> changé de <i>Nouveau</i> à <i>A étudier</i></li><li><strong>Version cible</strong> mis à <i>Mises à jour 2.3.11</i></li></ul><p>Rien dans <strong>/var/log/ead/ead-server</strong> par hasard ?</p> controle-vnc - Scénario #6022: La commande manage_station.py ne rend pas la main en cas de timeouthttps://dev-eole.ac-dijon.fr/issues/6022?journal_id=235612013-10-24T10:29:17ZJoël Cuissinatjoel.cuissinat@ac-dijon.fr
<ul><li><strong>Version cible</strong> changé de <i>Mises à jour 2.3.11</i> à <i>Mises à jour 2.3.12</i></li></ul> controle-vnc - Scénario #6022: La commande manage_station.py ne rend pas la main en cas de timeouthttps://dev-eole.ac-dijon.fr/issues/6022?journal_id=269872014-02-06T15:36:05ZFabrice Barconnièrefabrice.barconniere@region-academique-bourgogne-franche-comte.fr
<ul><li><strong>Version cible</strong> changé de <i>Mises à jour 2.3.12</i> à <i>Mises à jour 2.3.13</i></li></ul> controle-vnc - Scénario #6022: La commande manage_station.py ne rend pas la main en cas de timeouthttps://dev-eole.ac-dijon.fr/issues/6022?journal_id=302422014-05-05T09:54:16ZJoël Cuissinatjoel.cuissinat@ac-dijon.fr
<ul><li><strong>Version cible</strong> <del><i>Mises à jour 2.3.13</i></del> supprimé</li></ul> controle-vnc - Scénario #6022: La commande manage_station.py ne rend pas la main en cas de timeouthttps://dev-eole.ac-dijon.fr/issues/6022?journal_id=569232015-10-22T14:16:02ZEmmanuel GARETTE
<ul></ul><pre>
<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
</pre> controle-vnc - Scénario #6022: La commande manage_station.py ne rend pas la main en cas de timeouthttps://dev-eole.ac-dijon.fr/issues/6022?journal_id=569402015-10-22T15:49:09ZEmmanuel GARETTE
<ul><li><strong>Statut</strong> changé de <i>A étudier</i> à <i>Nouveau</i></li></ul><p>J'ai reproduit sur XP.</p>
<p>Si je lance à la main :</p>
<pre>
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
</pre>
<p>Dans l'EAD cela n'a pas l'air de s'arrêter :</p>
<pre>
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)
</pre>
<p>En python ca s'arrête bien aussi :</p>
<pre>
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:
>>>
</pre> controle-vnc - Scénario #6022: La commande manage_station.py ne rend pas la main en cas de timeouthttps://dev-eole.ac-dijon.fr/issues/6022?journal_id=570612015-10-23T14:34:42ZEmmanuel GARETTE
<ul><li><strong>Tracker</strong> changé de <i>Anomalie</i> à <i>Demande</i></li></ul><p>La commande peut mettre trop de temps. Une solution simple serait d'exécuter la commande dans "at".</p> controle-vnc - Scénario #6022: La commande manage_station.py ne rend pas la main en cas de timeouthttps://dev-eole.ac-dijon.fr/issues/6022?journal_id=574632015-10-29T09:15:14ZScrum Master
<ul><li><strong>Assigné à</strong> mis à <i>Emmanuel GARETTE</i></li></ul> controle-vnc - Scénario #6022: La commande manage_station.py ne rend pas la main en cas de timeouthttps://dev-eole.ac-dijon.fr/issues/6022?journal_id=576692015-11-02T10:52:41ZScrum Master
<ul><li><strong>Tâche parente</strong> mis à <i>#13757</i></li></ul> controle-vnc - Scénario #6022: La commande manage_station.py ne rend pas la main en cas de timeouthttps://dev-eole.ac-dijon.fr/issues/6022?journal_id=576702015-11-02T10:52:52ZScrum Master
<ul><li><strong>Assigné à</strong> <del><i>Emmanuel GARETTE</i></del> supprimé</li></ul> controle-vnc - Scénario #6022: La commande manage_station.py ne rend pas la main en cas de timeouthttps://dev-eole.ac-dijon.fr/issues/6022?journal_id=576712015-11-02T10:54:43ZScrum Master
<ul><li><strong>Tâche parente</strong> <del><i>#13757</i></del> supprimé</li></ul> controle-vnc - Scénario #6022: La commande manage_station.py ne rend pas la main en cas de timeouthttps://dev-eole.ac-dijon.fr/issues/6022?journal_id=576722015-11-02T10:55:32ZScrum Master
<ul><li><strong>Tracker</strong> changé de <i>Tâche</i> à <i>Demande</i></li><li><strong>Version cible</strong> <del><i>Sprint 2015 45-47 - Équipe MENESR</i></del> supprimé</li></ul><p>Etude de la demande</p> controle-vnc - Scénario #6022: La commande manage_station.py ne rend pas la main en cas de timeouthttps://dev-eole.ac-dijon.fr/issues/6022?journal_id=580102015-11-03T09:16:30ZScrum Master
<ul><li><strong>Assigné à</strong> mis à <i>developpeurs_eole</i></li></ul> controle-vnc - Scénario #6022: La commande manage_station.py ne rend pas la main en cas de timeouthttps://dev-eole.ac-dijon.fr/issues/6022?journal_id=587082015-11-10T13:45:18ZDaniel Dehennin
<ul></ul><p>Le problème est double :</p>
<ul>
<li>Il n’y a aucune gestion des timeout sur les appels de commande dans <a class="project" href="https://dev-eole.ac-dijon.fr/projects/ead">ead</a>.</li>
<li>La commande <strong><code>manage_station.py</code></strong> ne s’arrête jamais si la commande distante est bloquante</li>
</ul>
<p>Ce deuxième point n’est pas résolu par la gestion actuelle du timeout, en effet :</p>
<ul>
<li>L’objet <a href="https://twistedmatrix.com/documents/13.2.0/api/twisted.internet.defer.Deferred.html" class="external"><strong><code>Deferred</code></strong></a> a déjà subit un appel à <a href="https://twistedmatrix.com/documents/13.2.0/api/twisted.internet.defer.Deferred.html#callback" class="external"><strong><code>callback()</code></strong></a> pour exécuter la méthode <strong><code>shutdown()</code></strong> (<a class="source" href="https://dev-eole.ac-dijon.fr/projects/controle-vnc/repository/revisions/bbaa134/entry/backend/cliscribe.py#L122">controle-vnc:source:backend/cliscribe.py@bbaa134#L122</a>)</li>
<li>Le <a href="https://twistedmatrix.com/documents/13.2.0/api/twisted.internet.interfaces.IReactorTime.html#callLater" class="external"><strong><code>callLater</code></strong></a> appel la méthode <a href="https://twistedmatrix.com/documents/13.2.0/api/twisted.internet.defer.Deferred.html#errback" class="external"><strong><code>errback()</code></strong></a> sur l’objet <a href="https://twistedmatrix.com/documents/13.2.0/api/twisted.internet.defer.Deferred.html" class="external"><strong><code>Deferred</code></strong></a></li>
</ul>
<p>Cela conduit a la levée d’exception <strong><code>AlreadyCalledError</code></strong>.</p>
<p>Pour que la commande ne soit plus bloquante, il faut :</p>
<ol>
<li>Ne plus tester si <a href="https://twistedmatrix.com/documents/13.2.0/api/twisted.internet.defer.Deferred.html#callback" class="external"><strong><code>callback()</code></strong></a> a bien été appelé sur l’objet <a href="https://twistedmatrix.com/documents/13.2.0/api/twisted.internet.defer.Deferred.html" class="external"><strong><code>Deferred</code></strong></a> car c’est toujours le cas</li>
<li>Sauvegarder l’exception de timeout dans l’objet <strong><code>ClientScribe</code></strong> et arrêter le <a href="https://twistedmatrix.com/documents/13.2.0/api/twisted.internet.reactor.html" class="external"><strong><code>reactor</code></strong></a> sans exécuter les <a href="https://twistedmatrix.com/documents/13.2.0/api/twisted.internet.defer.Deferred.html#callback" class="external"><strong><code>callback()</code></strong></a> et <a href="https://twistedmatrix.com/documents/13.2.0/api/twisted.internet.defer.Deferred.html#errback" class="external"><strong><code>errback()</code></strong></a></li>
<li>Lever l’exception si elle est définie avant de sortir du script</li>
</ol> controle-vnc - Scénario #6022: La commande manage_station.py ne rend pas la main en cas de timeouthttps://dev-eole.ac-dijon.fr/issues/6022?journal_id=588662015-11-13T09:55:28ZDaniel Dehennin
<ul><li><strong>Tracker</strong> changé de <i>Demande</i> à <i>Scénario</i></li><li><strong>Echéance</strong> mis à <i>20/11/2015</i></li><li><strong>Assigné à</strong> <del><i>developpeurs_eole</i></del> supprimé</li><li><strong>Version cible</strong> mis à <i>Sprint 2015 45-47 - Équipe MENESR</i></li><li><strong>Début</strong> mis à <i>02/11/2015</i></li><li><strong>Release</strong> mis à <i>EOLE 2.5.2</i></li><li><strong>Points de scénarios</strong> mis à <i>2.0</i></li></ul><p>Passage sur le sprint pour appliquer le commit.</p> controle-vnc - Scénario #6022: La commande manage_station.py ne rend pas la main en cas de timeouthttps://dev-eole.ac-dijon.fr/issues/6022?journal_id=588672015-11-13T09:57:31ZDaniel Dehennin
<ul><li><strong>Projet</strong> changé de <i>ead</i> à <i>controle-vnc</i></li><li><strong>Sujet</strong> changé de <i>Plantage de EAD</i> à <i>La commande manage_station.py ne rend pas la main en cas de timeout</i></li></ul> controle-vnc - Scénario #6022: La commande manage_station.py ne rend pas la main en cas de timeouthttps://dev-eole.ac-dijon.fr/issues/6022?journal_id=592202015-11-18T15:57:38ZJoël Cuissinatjoel.cuissinat@ac-dijon.fr
<ul><li><strong>Statut</strong> changé de <i>Nouveau</i> à <i>Terminé (Sprint)</i></li></ul>