Commit cb47bb83 authored by Jérome Perrin's avatar Jérome Perrin

fixup! fixup! py2/py3: Make Products code compatible with both python2 and python3.

parent cc740218
Pipeline #21352 failed with stage
......@@ -37,7 +37,7 @@ def dump_threads():
Returns a string with the tracebacks.
"""
this_thread_id = thread.get_ident()
this_thread_id = _thread.get_ident()
now = time.strftime("%Y-%m-%d %H:%M:%S")
res = ["Threads traceback dump at %s\n" % now]
for thread_id, frame in six.iteritems(_current_frames()):
......
  • this (and cc740218 ) should repair the failures from https://erp5js.nexedi.net/#/test_result_module/20220509-B18D0F4A/14?page=form&view=view

    ======================================================================
    ERROR: test_deadlock_debugger (test.test_erp5.TestZopeMedusa)
    ----------------------------------------------------------------------
    Traceback (most recent call last):
      File "/srv/slapgrid/slappart16/t/cvt/soft/8eb01374f743d8eb0db3405d15cfc4db/parts/slapos-repository/software/erp5/test/test/test_erp5.py", line 801, in test_deadlock_debugger
        dump_response.raise_for_status()
      File "/srv/slapgrid/slappart16/t/cvt/soft/8eb01374f743d8eb0db3405d15cfc4db/eggs/requests-2.24.0-py2.7.egg/requests/models.py", line 941, in raise_for_status
        raise HTTPError(http_error_msg, response=self)
    HTTPError: 502 Server Error: Bad Gateway for url: https://zope:???@10.0.233.79:2152/manage_debug_threads?cyhk0XKzApyZrugU
    
    ======================================================================
    ERROR: test_deadlock_debugger (test.test_erp5.TestZopeWSGI)
    ----------------------------------------------------------------------
    Traceback (most recent call last):
      File "/srv/slapgrid/slappart16/t/cvt/soft/8eb01374f743d8eb0db3405d15cfc4db/parts/slapos-repository/software/erp5/test/test/test_erp5.py", line 801, in test_deadlock_debugger
        dump_response.raise_for_status()
      File "/srv/slapgrid/slappart16/t/cvt/soft/8eb01374f743d8eb0db3405d15cfc4db/eggs/requests-2.24.0-py2.7.egg/requests/models.py", line 941, in raise_for_status
        raise HTTPError(http_error_msg, response=self)
    HTTPError: 500 Server Error: Internal Server Error for url: https://zope:???@10.0.233.79:2152/manage_debug_threads?hiBOsO65vqxFkvKT

    ( https://softinst161145.host.vifib.net/cvt-33hU1oieme/erp5/test.test_erp5.TestZopeWSGI.test_deadlock_debugger/inst/z5/var/log/zope-0-event.log shows the actual error:

    ------
    2022-05-09 04:44:06,527 ERROR waitress Exception while serving /manage_debug_threads
    Traceback (most recent call last):
      File "/srv/slapgrid/slappart16/t/cvt/i/0/tmp/soft/4c87e4e2a445718484842963b6b170af/eggs/waitress-1.4.4-py2.7.egg/waitress/channel.py", line 350, in service
        task.service()
      File "/srv/slapgrid/slappart16/t/cvt/i/0/tmp/soft/4c87e4e2a445718484842963b6b170af/eggs/waitress-1.4.4-py2.7.egg/waitress/task.py", line 171, in service
        self.execute()
      File "/srv/slapgrid/slappart16/t/cvt/i/0/tmp/soft/4c87e4e2a445718484842963b6b170af/eggs/waitress-1.4.4-py2.7.egg/waitress/task.py", line 441, in execute
        app_iter = self.channel.server.application(environ, start_response)
      File "/srv/slapgrid/slappart16/t/cvt/i/0/tmp/soft/4c87e4e2a445718484842963b6b170af/eggs/waitress-1.4.4-py2.7.egg/waitress/proxy_headers.py", line 65, in translate_proxy_headers
        return app(environ, start_response)
      File "/srv/slapgrid/slappart16/t/cvt/i/0/tmp/soft/4c87e4e2a445718484842963b6b170af/parts/erp5/product/ERP5/bin/zopewsgi.py", line 54, in __call__
        return self.application(environ, replacement_start_response)
      File "/srv/slapgrid/slappart16/t/cvt/i/0/tmp/soft/4c87e4e2a445718484842963b6b170af/parts/erp5/product/ERP5/bin/zopewsgi.py", line 95, in app
        return [dump_threads()]
      File "/srv/slapgrid/slappart16/t/cvt/i/0/tmp/soft/4c87e4e2a445718484842963b6b170af/parts/erp5/product/DeadlockDebugger/dumper.py", line 40, in dump_threads
        this_thread_id = thread.get_ident()
    NameError: global name 'thread' is not defined
    ``` )
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment