ergo-services / ergo

An actor-based Framework with network transparency for creating event-driven architecture in Golang. Inspired by Erlang. Zero dependencies.
https://docs.ergo.services
MIT License
3.51k stars 138 forks source link

RPC call doesn't use timeout when an erlang node is down [v1.2.2] #50

Closed Noksa closed 3 years ago

Noksa commented 3 years ago

Hello!

I've found a new defect after 1.2.2.

You can easily reproduce it. Just call CallRPCWithTimeout function when an erlang node is down.

Log:

2021/05/11 09:52:16 [test@MBP-Alexandr] RPC calling: demo@MBP-Alexandr:erlang:system_info
2021/05/11 09:52:16 [test@MBP-Alexandr] sending message by tuple [rex demo@MBP-Alexandr]
2021/05/11 09:52:16 [test@MBP-Alexandr] can't connect to demo@MBP-Alexandr: Can't resolve port for demo@MBP-Alexandr: desired node not found

And the app is stuck

halturin commented 3 years ago

It seems the recent change caused this issue (Golang doc says we should read the channel if Stop() returns 'false', but it freezes in a certain case). Golang got a new timer behavior in the latest releases. It a bit confused me. Im going to fix it right away.

halturin commented 3 years ago

fixed and republished v1.2.2

Noksa commented 3 years ago

Oh thanks, you are so fast :)

halturin commented 3 years ago

just warming up before the work 😄

Noksa commented 3 years ago

I tried to remove the entire ~/go/pkg/mod directory and used go clean -modcache. But I can't download the last version which was republished. I even tried go get github.com/halturin/ergo@92cfd8f212cfef9ef2a9eb68dabbb7132bdb6f3a but still have the old version.

Do you know how I can download republished version?

PS: Dependencies in golang are evil...

halturin commented 3 years ago

It's weird. v1.2.2 points to 92cfd8f commit which is the latest one https://github.com/halturin/ergo/releases/tag/v1.2.2

Try to check out here $GOPATH/src/github.com

ps: might be it wasn't a good idea to update the release tag.

Noksa commented 3 years ago

Yeah, I can't figure out why golang still downloads previous version even if I use the latest commit's hash

halturin commented 3 years ago

I think i know. Along with go.mod there is go.sum which is points to the outdated commit. remove this file. it should be autogenerated.

Noksa commented 3 years ago

It didn't help :(

I also tried it within a docker container (so it is like a fresh install) and got the same behavior. It's really weird

Noksa commented 3 years ago

I found some info about republishing: https://golang.org/doc/modules/publishing

Note: Don't change a tagged version of a module after publishing it. 
For developers using the module, Go tools authenticate a downloaded module against the first downloaded copy. 
If the two differ, Go tools will return a security error. 
Instead of changing the code for a previously published version, publish a new version.
halturin commented 3 years ago

Just created a new tag - v1.2.2.1. Hope it fixes this problem.

Noksa commented 3 years ago

I think no 😄 Golang uses https://semver.org/ to version modules. This version is incorrect and golang can't use it :(

halturin commented 3 years ago

what a beautiful day :). created another one - v1.2.3.

Noksa commented 3 years ago

Haha, sorry for that :) And thanks a lot for your patience and help. Now it works! I hope it was the last issue from me.

halturin commented 3 years ago

It's ok; it was my fault. I should have paid more attention making the new release. Thanks for your reports. They make 'ergo' stable and more solid.