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

Check timeout on acquire #52

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
Open

Check timeout on acquire #52

wants to merge 9 commits into from

Conversation

nurse
Copy link
Contributor

@nurse nurse commented Sep 13, 2016

No description provided.

@coveralls
Copy link

Coverage Status

Coverage remained the same at 100.0% when pulling 7d9d66a on check-timeout-on-acquire into 914ad50 on master.

1 similar comment
@coveralls
Copy link

coveralls commented Sep 13, 2016

Coverage Status

Coverage remained the same at 100.0% when pulling 7d9d66a on check-timeout-on-acquire into 914ad50 on master.

@coveralls
Copy link

coveralls commented Sep 13, 2016

Coverage Status

Coverage remained the same at 100.0% when pulling fb94884 on check-timeout-on-acquire into 914ad50 on master.

From v0.9, AcquiredTask#timeout stores the time when it is acquired.
This commit changes the semantics to the last heartbeated time.
* Avoid to touch created_at because it is misused and maybe used in
  different meanings in the future. From v0.8.48, PQ can use timeout
  to find living tasks.
* Check timeout on heartbeat. v0.9's AcquiredTask#timeout saves the last
  heartbeated time. PQ can check whether the heartbeating task is still
  acquired by itself or not.
pass thread execution until monitor thread send heartbeat (or wait
while current alive time is available) and sleep for next heartbeat.
To confirm task is alive, wait task_heartbeat in set_task.
I thought timeout's meaning is changed in v0.9, now I can change its type.
@nurse nurse force-pushed the check-timeout-on-acquire branch from 1070de9 to 8fb4174 Compare September 14, 2016 09:59
@coveralls
Copy link

coveralls commented Sep 14, 2016

Coverage Status

Coverage remained the same at 100.0% when pulling 8fb4174 on check-timeout-on-acquire into c7045d2 on master.

@@ -145,10 +144,12 @@ def run

private
def task_heartbeat
@task.heartbeat!
task = @task
task.heartbeat!
Copy link
Contributor

Choose a reason for hiding this comment

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

Looks like that assigning task is unnecessary.

On prefetch, Processor keeps when it acquires the task.
@coveralls
Copy link

Coverage Status

Coverage remained the same at 100.0% when pulling b6fd7ff on check-timeout-on-acquire into c7045d2 on master.

1 similar comment
@coveralls
Copy link

coveralls commented Sep 14, 2016

Coverage Status

Coverage remained the same at 100.0% when pulling b6fd7ff on check-timeout-on-acquire into c7045d2 on master.

@coveralls
Copy link

coveralls commented Sep 16, 2016

Coverage Status

Coverage remained the same at 100.0% when pulling 93bbb20 on check-timeout-on-acquire into c7045d2 on master.

@kamipo
Copy link
Contributor

kamipo commented Sep 23, 2016

LGTM!!

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.

3 participants