When checking for valid Actor methods, the SDK no longer emits warnings about invalid or inappropriate method signatures for the ones needed to be implemented for each Actor type.
Fixes#585
Signed-off-by: Willi Eggeling <thewilli@users.noreply.github.com>
* feat: add golangci-lint version check
Add golangci-lint version check to compare the
local version against the workflow version.
Adds associated test workflow for mac, ubuntu and windows.
Signed-off-by: mikeee <hey@mike.ee>
* fix: add install linter step
Signed-off-by: mikeee <hey@mike.ee>
* fix: return the raw output of the command run
Signed-off-by: mikeee <hey@mike.ee>
* fix: change regex to pick up versions not prefixed
Signed-off-by: mikeee <hey@mike.ee>
* formatting: gofumpt'ed workspace
Signed-off-by: mikeee <hey@mike.ee>
* fix: convert line endings to LF on checkout
Signed-off-by: mikeee <hey@mike.ee>
* fix: encapsulate any spaces in the argument
Signed-off-by: mikeee <hey@mike.ee>
---------
Signed-off-by: mikeee <hey@mike.ee>
* Adds context to rest of funcs, so context can always be propagated.
Signed-off-by: joshvanl <me@joshvanl.dev>
* Use separate interface for structs with context funcs
Signed-off-by: joshvanl <me@joshvanl.dev>
* Update proto to include actor state transaction metadata
Signed-off-by: joshvanl <me@joshvanl.dev>
* Adds `SetWithTTL` to actor state store manager
Signed-off-by: joshvanl <me@joshvanl.dev>
* Update actor client to support sending metadata. Supports `ttlInSeconds`
Signed-off-by: joshvanl <me@joshvanl.dev>
* Update actor example to use SetWithTTL with note that it should always
be used
Signed-off-by: joshvanl <me@joshvanl.dev>
* Update go modules
Signed-off-by: joshvanl <me@joshvanl.dev>
* Ignore deprecated use of `actor.Server` in `ActorContainer` interface
Signed-off-by: joshvanl <me@joshvanl.dev>
---------
Signed-off-by: joshvanl <me@joshvanl.dev>
* Adds context to rest of funcs, so context can always be propagated.
Signed-off-by: joshvanl <me@joshvanl.dev>
* Adds `//nolint:interfacebloat` to StateManager interface due to new
`xxxContext` methods.
Signed-off-by: joshvanl <me@joshvanl.dev>
* Use separate interface for structs with context funcs
Signed-off-by: joshvanl <me@joshvanl.dev>
* Adds more locks to actor functions
Signed-off-by: joshvanl <me@joshvanl.dev>
---------
Signed-off-by: joshvanl <me@joshvanl.dev>
* Various fixed and cleanups
1. Fixed SDK not compiling and tests failing
2. Increased minimum Go version to 1.18
3. Removed `github.com/pkg/errors` and `go.uber.org/atomic` - replaced with the standard library instead (the old packages have been added to the "depguard" linter)
4. Upgraded all dependencies
5. Upgraded golangci-lint to support Go 1.18+
Signed-off-by: ItalyPaleAle <43508+ItalyPaleAle@users.noreply.github.com>
* Do not wrap error if nil
Signed-off-by: ItalyPaleAle <43508+ItalyPaleAle@users.noreply.github.com>
* Run CI on Go 1.18 and 1.19
Signed-off-by: ItalyPaleAle <43508+ItalyPaleAle@users.noreply.github.com>
* Restore compatibility with Go 1.18
Looks like the newer methods were added in Go 1.19 only
Signed-off-by: ItalyPaleAle <43508+ItalyPaleAle@users.noreply.github.com>
* Should fix validate_examples CI
Signed-off-by: ItalyPaleAle <43508+ItalyPaleAle@users.noreply.github.com>
* Updated (most) deprecated Actions
Signed-off-by: ItalyPaleAle <43508+ItalyPaleAle@users.noreply.github.com>
* Fix helm repo
Signed-off-by: ItalyPaleAle <43508+ItalyPaleAle@users.noreply.github.com>
* Determine latest Dapr version in a better way
Signed-off-by: ItalyPaleAle <43508+ItalyPaleAle@users.noreply.github.com>
* Fix validate.sh
Signed-off-by: ItalyPaleAle <43508+ItalyPaleAle@users.noreply.github.com>
Signed-off-by: ItalyPaleAle <43508+ItalyPaleAle@users.noreply.github.com>
* return the specific error type of the actor state, caused by empty key or unmarshal fail
Signed-off-by: wangxw <996268132@qq.com>
* Update state_async_provider.go
change log level of state load
Signed-off-by: wXwcoder <996268132@qq.com>
Signed-off-by: wangxw <996268132@qq.com>
Signed-off-by: wXwcoder <996268132@qq.com>
I was debugging a panic in a local application I was developing and noticed this issue. A validation failure isn't correctly handled as a failure, and we insert a nil value into the map. This value in this map is later dereferenced, resulting in the following panic:
```
http: panic serving 127.0.0.1:45598: runtime error: invalid memory address or nil pointer dereference
goroutine 248 [running]:
net/http.(*conn).serve.func1()
/home/linuxbrew/.linuxbrew/Cellar/go/1.19.1/libexec/src/net/http/server.go:1850 +0xbf
panic({0x9558a0, 0xe4d7c0})
/home/linuxbrew/.linuxbrew/Cellar/go/1.19.1/libexec/src/runtime/panic.go:890 +0x262
github.com/dapr/go-sdk/actor/manager.(*DefaultActorContainer).Invoke(0xc0000be810, {0xc000048126?, 0x9?}, {0xc0003fc000, 0x4, 0x200})
/home/cgillum/go/pkg/mod/github.com/dapr/go-sdk@v1.5.0/actor/manager/container.go:75 +0x299
github.com/dapr/go-sdk/actor/manager.(*DefaultActorManager).InvokeMethod(0xc000112300, {0xc000048115?, 0xc0000a3888?}, {0xc000048126, 0x4}, {0xc0003fc000, 0x4, 0x200})
/home/cgillum/go/pkg/mod/github.com/dapr/go-sdk@v1.5.0/actor/manager/manager.go:92 +0xb2
github.com/dapr/go-sdk/actor/runtime.(*ActorRunTime).InvokeActorMethod(0xa?, {0xc00004810c?, 0x7f71edd544a0?}, {0xc000048115, 0x9}, {0xc000048126, 0x4}, {0xc0003fc000, 0x4, 0x200})
/home/cgillum/go/pkg/mod/github.com/dapr/go-sdk@v1.5.0/actor/runtime/actor_runtime.go:75 +0xba
github.com/dapr/go-sdk/service/http.(*Server).registerBaseHandler.func4({0xad7298, 0xc0003b0000}, 0xc0004e4100)
/home/cgillum/go/pkg/mod/github.com/dapr/go-sdk@v1.5.0/service/http/topic.go:112 +0x1be
net/http.HandlerFunc.ServeHTTP(0xc0004e4000?, {0xad7298?, 0xc0003b0000?}, 0x800?)
/home/linuxbrew/.linuxbrew/Cellar/go/1.19.1/libexec/src/net/http/server.go:2109 +0x2f
github.com/gorilla/mux.(*Router).ServeHTTP(0xc000218240, {0xad7298, 0xc0003b0000}, 0xc0003b4600)
/home/cgillum/go/pkg/mod/github.com/gorilla/mux@v1.8.0/mux.go:210 +0x1cf
net/http.serverHandler.ServeHTTP({0xad62e8?}, {0xad7298, 0xc0003b0000}, 0xc0003b4600)
/home/linuxbrew/.linuxbrew/Cellar/go/1.19.1/libexec/src/net/http/server.go:2947 +0x30c
net/http.(*conn).serve(0xc0000001e0, {0xad7a00, 0xc00012b380})
/home/linuxbrew/.linuxbrew/Cellar/go/1.19.1/libexec/src/net/http/server.go:1991 +0x607
created by net/http.(*Server).Serve
/home/linuxbrew/.linuxbrew/Cellar/go/1.19.1/libexec/src/net/http/server.go:3102 +0x4db
```
The issue appears to be the error handling logic, which I've fixed in this PR.
Signed-off-by: Chris Gillum <cgillum@gmail.com>
Signed-off-by: Chris Gillum <cgillum@gmail.com>
* ftr: init go-sdk action
* fix: finished design of actor-api's invoke feature
* fix: add readme
* fix: lint
* fix: add manager unit test
* fix: add actor state suport
* fix: add comments
* fix: add comment
* fix the change reqeust of pr
* fix: validate example test
* fix: linter
* add actor validation
* add actor validation
* fix: update actor validation init sleep time
* fix: add init time for validate example server
* fix: change actor to the end of test in order not to let reminder bother other test
* fix: validate test
* fix: typo of factory
* fix: add init time
* fix: ut
Co-authored-by: Yaron Schneider <yaronsc@microsoft.com>
Co-authored-by: Long Dai <long.dai@intel.com>