Commit graph

3 commits

Author SHA1 Message Date
346752477b
[#12] mclock: Fix timer-based scheduling
All checks were successful
DCO action / DCO (pull_request) Successful in 21s
Vulncheck / Vulncheck (pull_request) Successful in 34s
Pre-commit hooks / Pre-commit (pull_request) Successful in 1m13s
Tests and linters / Tests with -race (pull_request) Successful in 1m14s
Tests and linters / Run gofumpt (pull_request) Successful in 1m13s
Tests and linters / gopls check (pull_request) Successful in 1m17s
Tests and linters / Lint (pull_request) Successful in 1m22s
Tests and linters / Staticcheck (pull_request) Successful in 1m18s
Tests and linters / Tests (pull_request) Successful in 1m27s
Let's assume that there are two requests in the queue with execution time t1 and t2.
The timer is set to t1. The timer is triggered, schedules the t1 request,
calculates the time for the next timer t2 to be triggered.
But it doesn't schedules timer to this time because of the
`q.timeBasedScheduleTs > nextTs` check.

Signed-off-by: Dmitrii Stepanov <d.stepanov@yadro.com>
2025-03-19 17:12:00 +03:00
d8663f1a74
[#1] mclock: Fix possible deadlock
There is a possible call-chain `scheduleRequest()` -> `runAt()` -> `scheduleRequest()`,
so second `scheduleRequest()` may be locked on mutext held by first `scheduleRequest()`.

Signed-off-by: Dmitrii Stepanov <d.stepanov@yadro.com>
2025-01-28 11:20:54 +03:00
47559a8d16
[#1] mclock: Refactor: split code between files
Signed-off-by: Dmitrii Stepanov <d.stepanov@yadro.com>
2025-01-28 11:20:53 +03:00