Support UniqueOpts without JobStateRunning in ByState
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 52/100
Hướng nghiên cứu
Start by tracing the UniqueOpts and InsertOpts definitions and the JobStateRunning handling referenced in this request. Compare the existing uniqueness behavior with the requested pending-versus-running cases; done means insertion skips a duplicate pending job but permits one when the existing job is running, while preserving transactional behavior.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
This is a followup to this issue and my comment here. I want to make a stand-alone feature request. So copying my comment here:
I am a newcomer to River, but explanation why JobStateRunning is required is surprising to me based on the rest of the documentation. UniqueOpts is part of InsertOpts and that to me means that it only controls when the job can be inserted, not how it can transition later on. For my use case (I described in https://github.com/riverqueue/river/issues/1178) I care that (transitionally) I can skip adding additional job if one is already pending, but not running. Jobs are designed so that they could run 100 of them in parallel, they are also idempotent, it is just that it is unnecessary to have more then one at any given time being scheduled to run.
About how many jobs are running in parallel, my understanding is that this is what concurrency limits are for, not insert options.
To me this is also surprising because when as a user I insert a job, it is never in any other state than an initial state. I cannot insert a job in the "running" state. That makes no sense. Only River can move job to a running state. So why would "InsertOps" control how can River move jobs between states? To me "InsertOps" is only about the user - can I as a user insert a job if any job is in a pending state but not yet running?
In fact, to me this is a feature: River should be able to transition any available job to running state. But if River does that, then my insertion (where "running" state is not among UniqueOpts) should transactionally succeed. And this is exactly the behavior I would need. If at any given moment job is not yet running or even not being started to be run, skip adding the job. It is unnecessary. The job which will shortly run will do the job. But if the job is already running, then schedule it. Because it might be that the job running will miss a bit of work.
- Ngôn ngữ chính
- Go
- Star
- 5.7k
- Fork
- 179
- Merge trung bình
- 2 ngày 19 giờ
- Pull request đã merge (30 ngày)
- 12
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
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của riverqueue/river
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 45/100
riverqueue/river#1358 · 1 bình luận ·
-
River job stuck at running Đang mở
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
riverqueue/river#1258 · 7 bình luận ·
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 45/100
riverqueue/river#1225 · 14 bình luận ·
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 52/100
riverqueue/river#1185 · 2 bình luận ·
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 30/100
riverqueue/river#1167 · 2 bình luận ·
Tất cả issue của riverqueue/river
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
bazel-contrib/rules_go#4726 · 1 bình luận ·
-
area/auto-scaling area/monitoring area/ops-productivity kind/enhancement
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
-
Type/Improvement
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 90/100
OpenNSW/nsw-srilanka#522 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 92/100