Skip to content

Conversation

@AnizR
Copy link
Contributor

@AnizR AnizR commented Dec 3, 2024

Goal

Do not keep jobs in 'started' status if their associated worker have been killed by a timeout and directly set it as 'failed'

@OCA-git-bot
Copy link
Contributor

Hi @guewen,
some modules you are maintaining are being modified, check this out!

Copy link
Member

@amh-mw amh-mw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a recurring problem for me, so I will backport to 15.0 shortly after merge.


for job in jobs:
if not psutil.pid_exists(job.worker_pid):
_logger.info("a process with pid %d does not exist" % job.worker_pid)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If I saw this in the logs, I don't think I'd know what to look for. Maybe say "a queue_job process" instead?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops, i forgot to remove it, it to ensure that it was working during my tests 😄

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I do think there is value in logging unexpected queue_job workers deaths with greater specificity than the generic werkzeug worker timeout message.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see, I updated the message to give the worker pid and the job uuid.

Copy link
Member

@guewen guewen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi, sadly the pid may be on another host and still executing

@AnizR
Copy link
Contributor Author

AnizR commented Dec 3, 2024

Hi, sadly the pid may be on another host and still executing

What would you advise ?
Making the server update the job before killing the worker? (extending the function process_timeout ? I have no idea if it is possible )

@amh-mw
Copy link
Member

amh-mw commented Dec 3, 2024

Hi, sadly the pid may be on another host and still executing

Record the hostname / other signature of the host and filter accordingly? Config parameter gate this feature?

@sbidoul
Copy link
Member

sbidoul commented Dec 4, 2024

@AnizR I think #423 was promising and is still the best approach I can think of.

@AnizR
Copy link
Contributor Author

AnizR commented Dec 6, 2024

This wasn't a good approach.
I have created another PR #716 that seems more promising.

@AnizR AnizR closed this Dec 6, 2024
@AnizR AnizR deleted the zra-imp-timeout branch December 6, 2024 10:56
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

Successfully merging this pull request may close these issues.

5 participants