Skip to content

v0.21

Compare
Choose a tag to compare
@mwhittaker mwhittaker released this 15 Sep 23:20
· 135 commits to main since this release
b3d336d

To use v0.21 of Service Weaver, run the following commands in the root of your application's module:

go get github.com/ServiceWeaver/weaver@v0.21                # Update the weaver module.
go install github.com/ServiceWeaver/weaver/cmd/weaver@v0.21 # Update the weaver command line tool.

Automatic Method Retries

Components are the core abstraction of Service Weaver. Two components can be co-located in the same process or distributed across multiple machines. When a component calls a method on a co-located component, the method call is performed as a regular Go method call. When a component calls a method on a component hosted on another machine, the method call is executed as a remote procedure call (RPC).

The network is not reliable, so RPCs can sometimes fail to execute properly. Starting in v0.21, the Service Weaver runtime automatically retries these RPCs for you. The retries are done with jittered exponential back-off, and retries are stopped when the provided context.Context is cancelled. Note that a method call that executes successfully and returns a non-nil error is not retried. Only method calls that fail to execute properly (e.g., because of a network failure) are retried.

Note that in some cases, it may not be safe to arbitrarily retry a method call. In these cases, you can mark a method as NotRetriable, and Service Weaver will not retry it for you.

type Foo interface {
    A(context.Context) error
}

var _ weaver.NotRetriable = Foo.A

weavertests will also spuriously retry method calls to catch any cases where you forget to mark a non-retriable method as non-retriable.

See #570 and #575 for details.

Prettier Logs

v0.21 introduces some small tweaks to our logging pretty printer. See #577, #578, and #579 for details.

pretty_logs

Bug Fixes

New Contributors

Full Changelog: v0.20.0...v0.21.0