-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
feat(engine, engine-rest-core) Add a query criteria to retrieve all executing jobs #4494
base: master
Are you sure you want to change the base?
feat(engine, engine-rest-core) Add a query criteria to retrieve all executing jobs #4494
Conversation
…xecuting jobs related to: camunda#4470
…k and processInstance
@venetrius any update on this? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The proposed logic does not exactly query jobs that are currently executing.
select * from act_ru_job where LOCK_EXP_TIME_ is not null and suspension_state_=1 and LOCK_EXP_TIME_ > currenttime
It is possible that LOCK_EXP_TIME_ > currenttime
but a job is not executing:
LOCK_EXP_TIME_
is first set when the job executor has acquired the job. However an acquired job might not get executed right away.
If a job failed LOCK_EXP_TIME_
might be updated with an icrement as part of the retry policy
It is also not guaranteed that no job is running if LOCK_EXP_TIME_ <= currenttime
. In a case where a job does not return within the LOCK_EXP_TIME_
the job can be acquired by a (different of same) job executor.
I recommend visiting our documentation on the The Job Executor
If the behaviour you want to achieve is still met with this query then one option would be to split executing
into two filters.
A query criteria to test if suspension is 1 already exists it is called active
A query criteria that checks if a job has a LOCK_EXP_TIME_
value in the future could be called aquired
.
Once the acquisition thread acquires a job, it sets LOCK_EXP_TIME_ in some future time and put that job in the job queue right? Isn't it mean its currently "executing"? However, I agree there might be other possible outcomes after that but at that point when the LOCK_EXP_TIME_ is in future time and suspension_state_ is active, my understanding is executing. Also, I am considering retries as "executing" since its the part of a job that is being executed.
Can the job be acquired though because the suspension_state_ will in active state not in suspended even though
@venetrius Thank you for your reply. Please review my above comments. Can you please suggest to add/remove from the query that I came up that would retrieve jobs that are currently executing? |
@venetrius any thoughts? |
@yanavasileva @venetrius any thoughts on this? |
Hi @prajwolbhandari1, |
@venetrius any thoughts or direction would be helpful. |
Hi @prajwolbhandari1, The API already supports the
Then when you can call the API with
the same SQL would be executed then what the current changes would introduce with the |
Perfect @venetrius and it makes sense, let me change the flag from 'executing' to 'acquired'. |
Closing due to lack of requested feedback. If you would like us to look at this, please provide the requested information to re-open the PR. |
@venetrius @yanavasileva can you please reopen this PR? I am in process of working on changes. Is it easier to open a new PR together OR reopen this? I am ok with either one. Thanks! |
Hi @prajwolbhandari1, |
@venetrius Just pushed a new commit. Please take a look at it. Thanks again @venetrius |
Thanks @prajwolbhandari1, |
related to: #4470