Skip to content

Commit

Permalink
(choria-io#98) avoid job processor stalling after repeated task not f…
Browse files Browse the repository at this point in the history
…ound states

Signed-off-by: R.I.Pienaar <[email protected]>
  • Loading branch information
ripienaar committed Dec 22, 2022
1 parent 075e84c commit 89d107b
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 7 deletions.
2 changes: 1 addition & 1 deletion generators/fs/godocker/Dockerfile.templ
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ RUN go mod init "{{ .Package.Name }}" && \

COPY main.go /usr/src/app/main.go

RUN go mod tidy -compat=1.17
RUN go mod tidy
RUN go build -v -o /app -ldflags="-s -w -extldflags=-static"

FROM alpine:latest
Expand Down
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ require (
github.com/choria-io/fisk v0.2.1
github.com/dustin/go-humanize v1.0.0
github.com/nats-io/jsm.go v0.0.35
github.com/nats-io/nats-server/v2 v2.9.9
github.com/nats-io/nats.go v1.21.0
github.com/nats-io/nats-server/v2 v2.9.10
github.com/nats-io/nats.go v1.22.1
github.com/onsi/ginkgo/v2 v2.6.1
github.com/onsi/gomega v1.24.2
github.com/prometheus/client_golang v1.14.0
Expand Down
8 changes: 4 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,10 @@ github.com/nats-io/jsm.go v0.0.35 h1:l03xuGttRA9b81Q0P/WEGm3e5DYof743ZEI4nQR3PUs
github.com/nats-io/jsm.go v0.0.35/go.mod h1:AkNKZTxbvdFBOJCdlKuLHsRlOP+AI4hV9REQKmq3sWw=
github.com/nats-io/jwt/v2 v2.3.0 h1:z2mA1a7tIf5ShggOFlR1oBPgd6hGqcDYsISxZByUzdI=
github.com/nats-io/jwt/v2 v2.3.0/go.mod h1:0tqz9Hlu6bCBFLWAASKhE5vUA4c24L9KPUUgvwumE/k=
github.com/nats-io/nats-server/v2 v2.9.9 h1:bmj0RhvHOc8+z5/RuhI38GqPwtkFAHQuU3e99FVA/TI=
github.com/nats-io/nats-server/v2 v2.9.9/go.mod h1:AB6hAnGZDlYfqb7CTAm66ZKMZy9DpfierY1/PbpvI2g=
github.com/nats-io/nats.go v1.21.0 h1:kQiWyQMMMIPjDR7NanrLhTnRUxWgU04yrzmYdq9JxCU=
github.com/nats-io/nats.go v1.21.0/go.mod h1:tLqubohF7t4z3du1QDPYJIQQyhb4wl6DhjxEajSI7UA=
github.com/nats-io/nats-server/v2 v2.9.10 h1:LMC46Oi9E6BUx/xBsaCVZgofliAqKQzRPU6eKWkN8jE=
github.com/nats-io/nats-server/v2 v2.9.10/go.mod h1:AB6hAnGZDlYfqb7CTAm66ZKMZy9DpfierY1/PbpvI2g=
github.com/nats-io/nats.go v1.22.1 h1:XzfqDspY0RNufzdrB8c4hFR+R3dahkxlpWe5+IWJzbE=
github.com/nats-io/nats.go v1.22.1/go.mod h1:tLqubohF7t4z3du1QDPYJIQQyhb4wl6DhjxEajSI7UA=
github.com/nats-io/nkeys v0.3.0/go.mod h1:gvUNGjVcM2IPr5rCsRsC6Wb3Hr2CQAm08dsxtV6A5y4=
github.com/nats-io/nkeys v0.3.1-0.20220214171627-79ae42e4d898 h1:FoO4iS4qOKmNWMvv4T48tpwH9C/bs97vN2X9O47My8Y=
github.com/nats-io/nkeys v0.3.1-0.20220214171627-79ae42e4d898/go.mod h1:gvUNGjVcM2IPr5rCsRsC6Wb3Hr2CQAm08dsxtV6A5y4=
Expand Down
1 change: 1 addition & 0 deletions processor.go
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@ func (p *processor) processMessage(ctx context.Context, item *ProcessItem) error
if errors.Is(err, ErrTaskNotFound) {
p.log.Warnf("Could not find task data for %s, discarding work item", item.JobID)
p.c.storage.TerminateItem(ctx, item)
p.limiter <- struct{}{} // todo handle this in a better place
return nil
}

Expand Down

0 comments on commit 89d107b

Please sign in to comment.