99designs / 99designs/cmdstalk

Jobs that timeout will never be able to run again

Đang mở
#2 6 bình luận 0 reaction 0 người được giao Xem trên GitHub
Ngôn ngữ chính
Go
Star
76
Fork
14
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

When a job overruns it's TTR, beanstalkd will increment the job's timeout stat and put it back on the work queue for another worker to reserve.

In an effort to prevent pathological jobs from dog-piling all available workers, `cmdstalk` [will bury a task it reserves that has timeouts greater than 1](https://github.com/99designs/cmdstalk/blob/master/broker/broker.go#L112). This means that once a task is buried because of a timeout, it will _always_ re-bury instantly each time it is kicked: the job becomes un-runnable.

Using just the `buried`, `kicked` and `timeout` counters, there does not appear to be a way to differentiate between "kicks due buries due to timeouts" in the way that would allow `cmdstalk` to bury a job the next time it is reserved after a timeout.

The `beanstalkd` protocol docs make mention of [a one second grace period](https://github.com/kr/beanstalkd/blob/master/doc/protocol.txt#L224) at the end of a reserve time - would it be possible to use this grace period to bury a timed out job in the "same run" as the timeout occurred?

Hướng dẫn đóng góp

Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này

Hướng nghiên cứu

The issue is in broker/broker.go line 112 where jobs with timeouts > 1 are buried. Examine the beanstalkd protocol's grace period mentioned in the docs to see if a job can be buried within the same run after a timeout. Look at how the timeout counter is tracked and when the bury decision is made. Test changes by running jobs that exceed TTR and checking if they become permanently buried.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
go, shell
Lĩnh vực
backend, cli, devtools
Loại issue
Lỗi
Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức độ hoạt động
Đình trệ
Độ rõ ràng
Khá rõ ràng
Mức phù hợp với người mới
45/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.