Project

General

Profile

Tâche #11500

Scénario #11288: Résoudre les problèmes d'instabilité constatés sur Zéphir 2.3.16

Limiter les risques de timeout des appels faits par les clients à la synchronisation

Added by Bruno Boiget over 6 years ago. Updated over 6 years ago.

Status:
Fermé
Priority:
Normal
Assigned To:
Start date:
05/06/2015
Due date:
% Done:

0%

Estimated time:
2.00 h
Spent time:
Remaining (hours):
0.0

Description

Des logs de ce type peuvent apparaître dans le backend Zéphir :

May  5 18:34:45 zephir zephir_backend: [-] Unhandled error in Deferred:
May  5 18:34:45 zephir zephir_backend: [-] Unhandled Error
May  5 18:34:45 zephir zephir_backend: [-] #011Traceback (most recent call last):
May  5 18:34:45 zephir zephir_backend: [-] #011  File "/usr/lib/python2.6/dist-packages/twisted/internet/defer.py", line 325, in unpause
May  5 18:34:45 zephir zephir_backend: [-] #011    self._runCallbacks()
May  5 18:34:45 zephir zephir_backend: [-] #011  File "/usr/lib/python2.6/dist-packages/twisted/internet/defer.py", line 371, in _runCallbacks
May  5 18:34:45 zephir zephir_backend: [-] #011    self.result = callback(self.result, *args, **kw)
May  5 18:34:45 zephir zephir_backend: [-] #011  File "/usr/lib/python2.6/dist-packages/twisted/internet/defer.py", line 330, in _continue
May  5 18:34:45 zephir zephir_backend: [-] #011    self.unpause()
May  5 18:34:45 zephir zephir_backend: [-] #011  File "/usr/lib/python2.6/dist-packages/twisted/internet/defer.py", line 325, in unpause
May  5 18:34:45 zephir zephir_backend: [-] #011    self._runCallbacks()
May  5 18:34:45 zephir zephir_backend: [-] #011--- <exception caught here> ---
May  5 18:34:45 zephir zephir_backend: [-] #011  File "/usr/lib/python2.6/dist-packages/twisted/internet/defer.py", line 371, in _runCallbacks
May  5 18:34:45 zephir zephir_backend: [-] #011    self.result = callback(self.result, *args, **kw)
May  5 18:34:45 zephir zephir_backend: [-] #011  File "/usr/lib/python2.6/dist-packages/twisted/web/xmlrpc.py", line 148, in _cbRender
May  5 18:34:45 zephir zephir_backend: [-] #011    request.finish()
May  5 18:34:45 zephir zephir_backend: [-] #011  File "/usr/lib/python2.6/dist-packages/twisted/web/http.py", line 900, in finish
May  5 18:34:45 zephir zephir_backend: [-] #011    "Request.finish called on a request after its connection was lost; " 
May  5 18:34:45 zephir zephir_backend: [-] #011exceptions.RuntimeError: Request.finish called on a request after its connection was lost; use Request.notifyFinish to keep track of this.

Après étude et utilisation de la fonction notifyFinish sur l'ensemble des requêtes reçues par le backend, le problème semble venir de la fonction maj_site (uucp_rpc.py) appelée par les clients lors de la synchronisation avec Zéphir.

Si la fonction met trop longtemps à répondre, le client abandonne l'appel (timeout xmlrpc), et ce message apparaît lorsque Zéphir termine le traitement des données remontées.

Associated revisions

Revision d6b717a0 (diff)
Added by Bruno Boiget over 6 years ago

Réponse plus rapide de la fonction maj_site (synchronisation des clients)

  • envoi de la réponse au client dès que le md5 de l'archive est validé
  • les traitements des données se font ensuite en mode deferred

ref #11500 @45m

History

#1 Updated by Bruno Boiget over 6 years ago

exemple de code pour détecter quelles fonctions se terminent après perte de la connexion client (dans backend/xmlrpceole.py) :

def request_error(err, uri, user, function, args):
    print "Requête terminée prématurément :" 
    print " * ", uri
    print " * ", user
    print " * ", function
    print " * ", args

modification du début de la fonction render de la classe XMLRPCEole :

    def render(self,request):
        """examine la requête transmise par le client et apelle la procédure
        correspondante si ses autorisations sont suffisantes""" 
        # test de l'authentification
        request.content.seek(0, 0)
        args, functionPath = xmlrpclib.loads(request.content.read())
        cred_user = request.getUser()
        cred_password = request.getPassword()
        request.notifyFinish().addErrback(request_error, request.uri, cred_user, args, functionPath)

#2 Updated by Bruno Boiget over 6 years ago

  • Remaining (hours) changed from 2.0 to 0.25

#3 Updated by Bruno Boiget over 6 years ago

  • Status changed from En cours to Résolu

#4 Updated by Joël Cuissinat over 6 years ago

  • Status changed from Résolu to Fermé
  • Remaining (hours) changed from 0.25 to 0.0

Also available in: Atom PDF