Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Jobs stuck in pending in odoo.sh. #244

Closed
NMisko opened this issue Jun 26, 2020 · 7 comments
Closed

Jobs stuck in pending in odoo.sh. #244

NMisko opened this issue Jun 26, 2020 · 7 comments

Comments

@NMisko
Copy link

NMisko commented Jun 26, 2020

When running locally, for some reason the queue is processed, if --worker 0 is set. On odoo.sh it doesn't work.
Does someone know why it might work locally? Thanks!

@NMisko NMisko changed the title Are multiple workers actually required? Queue works locally with 0 workers. Jun 26, 2020
@guewen
Copy link
Member

guewen commented Jun 29, 2020

What configuration parameters do you use? Did you add queue_job in --load or SERVER_WIDE_MODULES?

@guewen
Copy link
Member

guewen commented Jun 29, 2020

Someone reported they could make it work on odoo.sh: #169

@NMisko
Copy link
Author

NMisko commented Jul 1, 2020

My configuration file:

[options]
dbfilter=
server_wide_modules = web,queue_job

[queue_job]
channels = root:4
host="https://myproject-xxxx.dev.odoo.com"
port=443
http_auth_user="admin"
http_auth_password="admin"

On restart I get the following in the logs:

2020-07-01 11:07:23,190 289 INFO ? odoo.addons.queue_job.jobrunner.runner: starting
2020-07-01 11:07:23,190 289 INFO ? odoo.addons.queue_job.jobrunner.runner: initializing database connections
2020-07-01 11:07:23,206 289 INFO ? odoo.addons.queue_job.jobrunner.runner: queue job runner ready for db xxx
2020-07-01 11:07:23,207 289 INFO ? odoo.addons.queue_job.jobrunner.runner: database connections read

On queuing a job:

2020-07-01 11:07:23,207 289 INFO ? odoo.addons.queue_job.jobrunner.runner: asking Odoo to run job 1519880e-cc68-42da-9b88-26b1072187e4 on db xxx
2020-07-01 11:07:23,209 289 INFO ? odoo.addons.queue_job.jobrunner.runner: obtaining an anonymous session for the job runner 

The job is then set to pending and never changes state, except on restart, it gets set to enqueued.

I'm gonna ask odoo support and ask in the other thread, as well.

@NMisko NMisko changed the title Queue works locally with 0 workers. Jobs stuck in pending in odoo.sh. Jul 1, 2020
@NMisko
Copy link
Author

NMisko commented Jul 7, 2020

Odoo support response:

Thank you for contacting Odoo Support.
There is a specific cron management on Odoo.sh and third-party modules such as queue_job are generally incompatible with it.
https://www.odoo.com/documentation/user/13.0/odoo_sh/advanced/frequent_technical_questions.html
In particular, due to the nature of the Odoo.sh platform, this module won’t work well: the platform is designed to pause services on idle traffic. This is also is why we have separate workers for the crons.
Moreover, Odoo.sh does not support daemons either long-living processes, so your job queue could be interrupted at any time. As the module is not designed to be fault-tolerant, you will for sure encounter problems.
For these reasons, we do not advise our users to use this module on Odoo.sh.

-> Not advised to use on Odoo.sh

@NMisko NMisko closed this as completed Jul 7, 2020
@guewen
Copy link
Member

guewen commented Oct 9, 2020

-> Not advised to use on Odoo.sh

I'm not sure that's correct. There is indeed currently an issue described in #169 (comment), which should be solved by #256. But this:

As the module is not designed to be fault-tolerant, you will for sure encounter problems.

It's not totally accurate, as we have a cron that requeue jobs stucked in the state enqueued.

so your job queue could be interrupted at any time

If the job is already started, it is handled by a normal worker, which will not be interrupted (otherwise, http requests from users could be interrupted too). Also, as the services are paused when the traffic is idle, it means it will be stopped when the queue has finish to process its queue. A case that may give unexpected results is if we have a job with an eta (estimated time of arrival), which may start only when the workers stop to be idle and the jobrunner restarts (but eta is not meant to give a precise time of execution anyway, only a "not before x").

@itpetarabia
Copy link

My configuration file:

[options]
dbfilter=
server_wide_modules = web,queue_job

[queue_job]
channels = root:4
host="https://myproject-xxxx.dev.odoo.com"
port=443
http_auth_user="admin"
http_auth_password="admin"

On restart I get the following in the logs:

2020-07-01 11:07:23,190 289 INFO ? odoo.addons.queue_job.jobrunner.runner: starting
2020-07-01 11:07:23,190 289 INFO ? odoo.addons.queue_job.jobrunner.runner: initializing database connections
2020-07-01 11:07:23,206 289 INFO ? odoo.addons.queue_job.jobrunner.runner: queue job runner ready for db xxx
2020-07-01 11:07:23,207 289 INFO ? odoo.addons.queue_job.jobrunner.runner: database connections read

On queuing a job:

2020-07-01 11:07:23,207 289 INFO ? odoo.addons.queue_job.jobrunner.runner: asking Odoo to run job 1519880e-cc68-42da-9b88-26b1072187e4 on db xxx
2020-07-01 11:07:23,209 289 INFO ? odoo.addons.queue_job.jobrunner.runner: obtaining an anonymous session for the job runner 

The job is then set to pending and never changes state, except on restart, it gets set to enqueued.

I'm gonna ask odoo support and ask in the other thread, as well.

How did you restart your odoo instance on Odoo.sh ?

@guewen
Copy link
Member

guewen commented Nov 24, 2022

The job runner will not work on odoo.sh
You can use the module queue_job_cron_jobrunner that uses a Cron to enqueued jobs. Not all features are supported though https://github.com/OCA/queue/tree/16.0/queue_job_cron_jobrunner

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants