From e32eede353e68dfa06daac5a959f0ee2f03d2053 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=90=D0=BD=D0=B4=D1=80=D1=96=D0=B9=20=D0=A8=D0=BE=D0=B2?= =?UTF-8?q?=D0=BA=D0=BE=D1=88=D0=B8=D1=82=D0=BD=D0=B8=D0=B9?= <198119344+enlightened88@users.noreply.github.com> Date: Mon, 27 Apr 2026 12:27:41 +0300 Subject: [PATCH 1/3] fix: prevent duty loss and fix misleading comment in deadliner MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Андрій Шовкошитний <198119344+enlightened88@users.noreply.github.com> --- core/deadline.go | 24 +++++++++--------------- 1 file changed, 9 insertions(+), 15 deletions(-) diff --git a/core/deadline.go b/core/deadline.go index 663e711fb9..0e858fa107 100644 --- a/core/deadline.go +++ b/core/deadline.go @@ -176,20 +176,14 @@ func (d *deadliner) run(ctx context.Context, deadlineFunc DeadlineFunc) { setCurrState() } case <-currTimer.Chan(): - // Send deadlined duty to receiver. - select { - case <-ctx.Done(): - return - case d.deadlineChan <- currDuty: - default: - log.Warn(ctx, "Deadliner output channel full", nil, - z.Str("label", d.label), - z.Any("duty", currDuty), - ) - } - - delete(duties, currDuty) - setCurrState() + select { + case <-ctx.Done(): + return + case d.deadlineChan <- currDuty: + } + + delete(duties, currDuty) + setCurrState() } } } @@ -217,7 +211,7 @@ func (d *deadliner) C() <-chan Duty { return d.deadlineChan } -// getCurrDuty gets the duty to process next along-with the duty deadline. It selects duty with the latest deadline. +// getCurrDuty gets the duty to process next along-with the duty deadline. It selects duty with the earliest deadline. func getCurrDuty(duties map[Duty]bool, deadlineFunc DeadlineFunc) (Duty, time.Time) { var currDuty Duty From ac87b6cb52075621a989a0573dafcfa29c5c33b5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=90=D0=BD=D0=B4=D1=80=D1=96=D0=B9=20=D0=A8=D0=BE=D0=B2?= =?UTF-8?q?=D0=BA=D0=BE=D1=88=D0=B8=D1=82=D0=BD=D0=B8=D0=B9?= <198119344+enlightened88@users.noreply.github.com> Date: Tue, 28 Apr 2026 12:11:10 +0300 Subject: [PATCH 2/3] Update core/deadline.go MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Signed-off-by: Андрій Шовкошитний <198119344+enlightened88@users.noreply.github.com> --- core/deadline.go | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/core/deadline.go b/core/deadline.go index 0e858fa107..9de0186225 100644 --- a/core/deadline.go +++ b/core/deadline.go @@ -176,14 +176,14 @@ func (d *deadliner) run(ctx context.Context, deadlineFunc DeadlineFunc) { setCurrState() } case <-currTimer.Chan(): - select { - case <-ctx.Done(): - return - case d.deadlineChan <- currDuty: - } - - delete(duties, currDuty) - setCurrState() + select { + case <-ctx.Done(): + return + case d.deadlineChan <- currDuty: + } + + delete(duties, currDuty) + setCurrState() } } } From 3fc8728fe54cf83b9f6659871376ce1bc6dd3200 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=90=D0=BD=D0=B4=D1=80=D1=96=D0=B9=20=D0=A8=D0=BE=D0=B2?= =?UTF-8?q?=D0=BA=D0=BE=D1=88=D0=B8=D1=82=D0=BD=D0=B8=D0=B9?= <198119344+enlightened88@users.noreply.github.com> Date: Tue, 28 Apr 2026 12:11:25 +0300 Subject: [PATCH 3/3] Update core/deadline.go MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Signed-off-by: Андрій Шовкошитний <198119344+enlightened88@users.noreply.github.com> --- core/deadline.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/deadline.go b/core/deadline.go index 9de0186225..445f794a85 100644 --- a/core/deadline.go +++ b/core/deadline.go @@ -211,7 +211,7 @@ func (d *deadliner) C() <-chan Duty { return d.deadlineChan } -// getCurrDuty gets the duty to process next along-with the duty deadline. It selects duty with the earliest deadline. +// getCurrDuty gets the duty to process next along with the duty deadline. It selects duty with the earliest deadline. func getCurrDuty(duties map[Duty]bool, deadlineFunc DeadlineFunc) (Duty, time.Time) { var currDuty Duty