OCA / queue

Asynchronous Job Queue
GNU Affero General Public License v3.0
184 stars 460 forks source link

Cannot install queue_job on odoo 16/windows (OSError: [WinError 10038] An operation was attempted on something that is not a socket) #564

Open johancitybee opened 1 year ago

johancitybee commented 1 year ago

When installing queue_job on odoo 16 community + enterprise edition, the queue_job does not start correctly (although jobs seems to be aunched correctly) and the log displays the same error message every 5 seconds

Module

queue_job

Describe the bug

After installing the module on a pristine DB running odoo 16 and following installation instructions (server_wide_modules = web,web_kanban,queue_job), restarting odoo, the following error message shows up every 5 seconds: 2023-09-25 19:48:32,476 4704 INFO ? odoo.addons.queue_job.jobrunner.runner: initializing database connections 2023-09-25 19:48:32,591 4704 INFO ? odoo.addons.queue_job.jobrunner.runner: queue job runner ready for db dev16 2023-09-25 19:48:32,591 4704 INFO ? odoo.addons.queue_job.jobrunner.runner: database connections ready 2023-09-25 19:48:32,591 4704 ERROR ? odoo.addons.queue_job.jobrunner.runner: exception: sleeping 5s and retrying Traceback (most recent call last): File "c:\git\wr-odoo-addons\3rd-parties\addons\queue_job\jobrunner\runner.py", line 521, in run self.wait_notification() File "c:\git\wr-odoo-addons\3rd-parties\addons\queue_job\jobrunner\runner.py", line 494, in waitnotification events = sel.select(timeout=timeout) ^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Program Files\Python311\Lib\selectors.py", line 323, in select r, w, = self._select(self._readers, self._writers, [], timeout) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Program Files\Python311\Lib\selectors.py", line 314, in _select r, w, x = select.select(r, w, w, timeout) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ OSError: [WinError 10038] An operation was attempted on something that is not a socket

To Reproduce

16.0.2.5.0

Steps to reproduce the behavior:

  1. Install queue_job on a new DB running odoo 16 / odoo enterrpsie 16 on windows 11
  2. Restart odoo-bin with server_wide_modules conf
  3. Error message shows up.

Expected behavior Not sure the error message should pop up, although feature seems to be working properly

Additional context Windows 11 / python 3.11.4 / pip 23.1.2

wimvanhouts commented 1 year ago

I encounter the same issue, and, it is filling the logs with exceptions. The cause is actually described here: https://docs.python.org/3/library/select.html#select.select. Calling select() on something that is not a winsock thing on windows results in this specific error.

The none winsock thing in the list of connections is a pipe that is created. See runner.py, line 368 self._stop_pipe = os.pipe()

This is added to the list of connections (runner.py line 472) to interrupt the select when the stop function is called (runner.py line 505)

This is probably done to free the select call that would otherwise be blocking if no data would be send over the sockets (and you have to wait for the select timeout).

Unfortunately, even though the cause is clear, I do not have a solution (yet)

nesryn commented 10 months ago

Has anyone found a solution?

Maralai commented 6 months ago

I believe I have this resolved in this PR: https://github.com/OCA/queue/pull/647

github-actions[bot] commented 1 week ago

There hasn't been any activity on this issue in the past 6 months, so it has been marked as stale and it will be closed automatically if no further activity occurs in the next 30 days. If you want this issue to never become stale, please ask a PSC member to apply the "no stale" label.