Development #44021
Le code dans hobo.multitenant.threads ne fonctionne pas en python3
0%
Description
[passerelle-hautes-alpes.test.entrouvert.org] ERROR: error running hourly job (TypeError('super(type, obj): obj must be an instance or subtype of type',)) ERROR: TypeError: super(type, obj): obj must be an instance or subtype of type ERROR: File "/usr/lib/python3/dist-packages/hobo/multitenant/threads.py", line 34, in __init__ ERROR: ERROR: super(TenantAwareThread, self).__init__(*args, **kwargs) ERROR: File "/usr/lib/python3/dist-packages/paramiko/transport.py", line 1731, in run ERROR: self.__timer = threading.Timer(float(timeout), self.read_timer) ERROR: File "/usr/lib/python3.5/threading.py", line 1166, in __init__ ERROR: Thread.__init__(self) ERROR: File "/usr/lib/python3/dist-packages/paramiko/packet.py", line 201, in start_handshake ERROR: self.packetizer.start_handshake(self.handshake_timeout) ERROR: Traceback (most recent call last): ERROR: Unknown exception: super(type, obj): obj must be an instance or subtype of type
Fichiers
Révisions associées
py3: adapt support of multitenant in threads (#44021)
Historique
Mis à jour par Thomas Noël il y a presque 4 ans
J'ai regardé sans avoir rien vu : l'endroit où un hourly utilise paramiko, c'est mdel_ddpacs
Mis à jour par Benjamin Dauvergne il y a presque 4 ans
Ok c'est paramiko qui lance des threads et le code thread/tenant-aware de hobo qui interagissent, et pour les logs verbeux ça doit venir d'une interception d'exception par paramiko parce que ça vient du logger paramiko.transport
qui n'est clairement pas à nous. Je vais regarder ça, la correction sera vraisemblablement dans hobo.
Mis à jour par Benjamin Dauvergne il y a presque 4 ans
- Projet changé de Passerelle à Hobo
- Sujet changé de error running hourly job (TypeError('super(type, obj): obj must be an instance or subtype of type',)) à Le code dans hobo.multitenant.threads ne fonctionne pas en python3
- Assigné à mis à Benjamin Dauvergne
A priori là c'est la différence entre ça (py27) :
def Timer(*args, **kwargs): """Factory function to create a Timer object. Timers call a function after a specified number of seconds: t = Timer(30.0, f, args=[], kwargs={}) t.start() t.cancel() # stop the timer's action if it's still waiting """ return _Timer(*args, **kwargs)
et ça (py38):
class Timer(Thread): """Call a function after a specified number of seconds: t = Timer(30.0, f, args=None, kwargs=None) t.start() t.cancel() # stop the timer's action if it's still waiting """
on continue à définir threading._Timer qui n'existe plus.
Mis à jour par Benjamin Dauvergne il y a presque 4 ans
- Fichier 0001-tests_multitenant-test-threading.Timer-44021.patch 0001-tests_multitenant-test-threading.Timer-44021.patch ajouté
- Fichier 0002-py3-adapt-support-of-multitenant-in-threads-44021.patch 0002-py3-adapt-support-of-multitenant-in-threads-44021.patch ajouté
- Tracker changé de Bug à Development
- Statut changé de Nouveau à Solution proposée
- Patch proposed changé de Non à Oui
Mis à jour par Benjamin Dauvergne il y a presque 4 ans
- Fichier 0001-tests_multitenant-test-threading.Timer-44021.patch 0001-tests_multitenant-test-threading.Timer-44021.patch ajouté
- Fichier 0002-py3-adapt-support-of-multitenant-in-threads-44021.patch 0002-py3-adapt-support-of-multitenant-in-threads-44021.patch ajouté
Encore un cas où les tests ne testaient rien du tout :/
Mis à jour par Serghei Mihai il y a presque 4 ans
Il reste un import sys
non-utilisé.
Sinon looks good for me, mais je laisse d'autres regards dire quoi.
Mis à jour par Serghei Mihai il y a presque 4 ans
- Statut changé de Solution proposée à Solution validée
Mis à jour par Frédéric Péters il y a presque 4 ans
- Statut changé de Solution validée à Résolu (à déployer)
J'ai poussé les commits.
commit c448546dbe0ffddaef4959c9f2cfd88b5d154afa Author: Benjamin Dauvergne <bdauvergne@entrouvert.com> Date: Mon Jun 15 11:56:12 2020 +0200 py3: adapt support of multitenant in threads (#44021) commit 6361be78c9dc84237fd145c6916a910356014189 Author: Benjamin Dauvergne <bdauvergne@entrouvert.com> Date: Mon Jun 15 11:55:49 2020 +0200 tests_multitenant: test threading.Timer (#44021)
Mis à jour par Frédéric Péters il y a presque 4 ans
- Statut changé de Résolu (à déployer) à Solution déployée
tests_multitenant: test threading.Timer (#44021)