Worker pool stats broken
Nobody has claimed this yet.
- Dominant language
- Erlang
- Stars
- 16
- Forks
- 12
- PR merge metrics
- No merged PRs in 30d
Description
When a worker is checked out from a pool (i.e. through a call to riak_core_worker_pool:poolboy_checkout/3 the timestamp of the checkout is updated on the list of checkouts. A queue_time stat is updated by comparing the time the job was added to the queue with now.
When a worker is checked back into the pool (i.e. through a call to riak_core_worker_pool:poolboy_checkin/4, a work_time stat is updated by comparing the checkout time for this pid with now.
However, if work is completed, and there is work queued handle_event({checkin, Worker} bypasses the poolboy_checkin/4 and poolboycheckout/3 functions, and simply allocates the next work in the queue directly to the checked in process.
This means when there is a large queue, and workers are continually recycled fresh work - the stats no longer make sense. For example, only when the queue is emptied will the work_time be recorded, and this will not be the time for the individual piece of work but the time since the worker first became busy.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing riak_core_worker_pool:poolboy_checkout/3, poolboy_checkin/4, poolboycheckout/3, and handle_event({checkin, Worker}). Reproduce a continuously queued workload and inspect how checkout, queue_time, and work_time are updated. Done means the stats represent each individual queued job and worker handoff, including when work is recycled directly.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- erlang
- Domain
- distributed-systems
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100