diff --git a/CHANGELOG.md b/CHANGELOG.md index 2b5826a7eb..9e71365dfd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -23,7 +23,7 @@ For details about compatibility between different releases, see the **Commitment ### Security -## [3.28.0] - unreleased +## [3.28.0] - 2023-10-31 ### Added diff --git a/data/lorawan-devices b/data/lorawan-devices index 844d631c05..341ea4c310 160000 --- a/data/lorawan-devices +++ b/data/lorawan-devices @@ -1 +1 @@ -Subproject commit 844d631c05cd29476b3619061cbddd59037020b4 +Subproject commit 341ea4c310c02b020cbf7262f18c182ff46d42dc diff --git a/data/lorawan-webhook-templates b/data/lorawan-webhook-templates index 62f572e227..2c03558427 160000 --- a/data/lorawan-webhook-templates +++ b/data/lorawan-webhook-templates @@ -1 +1 @@ -Subproject commit 62f572e227ecad348cfada942c332967b4a3914e +Subproject commit 2c0355842769995e3f1d304d004303d9671febe0 diff --git a/package.json b/package.json index f466eba1ea..e4621069d3 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "ttn-stack", - "version": "3.27.2", + "version": "3.28.0", "description": "The Things Stack", "main": "index.js", "repository": "https://github.com/TheThingsNetwork/lorawan-stack.git", diff --git a/pkg/events/batch/batch.go b/pkg/events/batch/batch.go index 86ed535a6c..dbbabf7abb 100644 --- a/pkg/events/batch/batch.go +++ b/pkg/events/batch/batch.go @@ -41,7 +41,7 @@ func (bp *batchPublisher) process(ctx context.Context) error { flushed := false for n := len(batch); n >= lowerBound; n = len(batch) { toFlush := n - if upperBound := 2 * lowerBound; n > upperBound { + if upperBound := 2 * bp.targetSize; n > upperBound { toFlush = upperBound } select { diff --git a/pkg/networkserver/grpc_asns.go b/pkg/networkserver/grpc_asns.go index e67cae7018..acd2ee4236 100644 --- a/pkg/networkserver/grpc_asns.go +++ b/pkg/networkserver/grpc_asns.go @@ -105,7 +105,10 @@ func (ns *NetworkServer) processApplicationUplinkTask(ctx context.Context, consu } cl := ttnpb.NewNsAsClient(conn) if err := ns.sendApplicationUplinks(ctx, cl, ups...); err != nil { - log.FromContext(ctx).WithError(err).Error("Failed to send application uplinks") + log.FromContext(ctx).WithError(err).Warn("Failed to send application uplinks") + if !retryableUplinkError(err) { + return nil + } return err } return nil diff --git a/pkg/networkserver/utils.go b/pkg/networkserver/utils.go index 256896f7d3..ba4cca23d7 100644 --- a/pkg/networkserver/utils.go +++ b/pkg/networkserver/utils.go @@ -412,10 +412,6 @@ func (ns *NetworkServer) submitApplicationUplinks(ctx context.Context, ups ...*t )) if err := ns.uplinkSubmissionPool.Publish(ctx, ups); err != nil { log.FromContext(ctx).WithError(err).Warn("Failed to enqueue application uplinks in submission pool") - if nonRetryableUplinkError(err) { - log.FromContext(ctx).Warn("Error is non-retryable, dropping application uplinks") - return - } ns.enqueueApplicationUplinks(ctx, ups...) return } @@ -430,8 +426,7 @@ func (ns *NetworkServer) handleUplinkSubmission(ctx context.Context, ups []*ttnp } if err := ns.sendApplicationUplinks(ctx, ttnpb.NewNsAsClient(conn), ups...); err != nil { log.FromContext(ctx).WithError(err).Warn("Failed to send application uplinks to Application Server") - if nonRetryableUplinkError(err) { - log.FromContext(ctx).Warn("Error is non-retryable, dropping application uplinks") + if !retryableUplinkError(err) { return } ns.enqueueApplicationUplinks(ctx, ups...) @@ -471,12 +466,10 @@ var ( } ) -func nonRetryableUplinkError(err error) bool { - return errors.IsFailedPrecondition(err) || +func retryableUplinkError(err error) bool { + return errors.IsCanceled(err) || + errors.IsDeadlineExceeded(err) || errors.IsResourceExhausted(err) || errors.IsAborted(err) || - errors.IsUnauthenticated(err) || - errors.IsPermissionDenied(err) || - errors.IsUnimplemented(err) || - errors.IsInternal(err) + errors.IsUnavailable(err) } diff --git a/pkg/version/ttn.go b/pkg/version/ttn.go index 2fa9d9073f..8c7d64eca3 100644 --- a/pkg/version/ttn.go +++ b/pkg/version/ttn.go @@ -3,4 +3,4 @@ package version // TTN Version -var TTN = "3.27.2-dev" +var TTN = "3.28.0-dev" diff --git a/sdk/js/package.json b/sdk/js/package.json index 56f7bddc89..1db9aea484 100644 --- a/sdk/js/package.json +++ b/sdk/js/package.json @@ -1,6 +1,6 @@ { "name": "ttn-lw", - "version": "3.27.2", + "version": "3.28.0", "description": "The Things Stack for LoRaWAN JavaScript SDK", "url": "https://github.com/TheThingsNetwork/lorawan-stack/tree/default/sdk/js", "main": "dist/index.js",