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.67k stars 143 forks source link

Command timed out when CallRPC is used #42

Closed Noksa closed 3 years ago

Noksa commented 3 years ago

Hello.

I've installed erlang@22 via homebrew and started an erlang node:

➜ ~ /usr/local/opt/erlang@22/bin/erl -sname demo@MBP-Alexandr -setcookie 123 -kernel logger_level info
Erlang/OTP 22 [erts-10.7.2.8] [source] [64-bit] [smp:12:12] [ds:12:12:10] [async-threads:1] [hipe] [dtrace]

=PROGRESS REPORT==== 28-Apr-2021::18:57:43.349637 ===
    application: kernel
    started_at: 'demo@MBP-Alexandr'
=PROGRESS REPORT==== 28-Apr-2021::18:57:43.354807 ===
    application: stdlib
    started_at: 'demo@MBP-Alexandr'
Eshell V10.7.2.8  (abort with ^G)
(demo@MBP-Alexandr)1>

And then I use the following code to send a command via RPC:

        log.Println("Attempt")
        q, e := demoGS.process.CallRPCWithTimeout(30, "demo@MBP-Alexandr", "erlang", "node")
        log.Println(q, e)
        process.Kill()

But I always get an error: timeout

So logs from demo erlang node have the following text:

(demo@MBP-Alexandr)1> =ERROR REPORT==== 28-Apr-2021::18:59:43.240434 ===
** Node 'test@MBP-Alexandr' not responding **
** Removing (timedout) connection **

And logs from go-erlang:

2021/04/28 18:58:03 [test@MBP-Alexandr] RPC calling: demo@MBP-Alexandr:erlang:node
2021/04/28 18:58:03 [test@MBP-Alexandr] sending message by tuple [rex demo@MBP-Alexandr]
2021/04/28 18:58:03 [test@MBP-Alexandr] registering peer &{demo@MBP-Alexandr [<nil> <nil> <nil> <nil> <nil> <nil> <nil> <nil> <nil> <nil> <nil> <nil>] 0 12 {0 0}}
2021/04/28 18:58:03 Node control: etf.Tuple{6, etf.Pid{Node:"demo@MBP-Alexandr", ID:0x36, Serial:0x0, Creation:0x2}, "", "global_name_server"}
2021/04/28 18:58:03 [test@MBP-Alexandr] sending message by name global_name_server
2021/04/28 18:58:03 [test@MBP-Alexandr] sending message by pid {test@MBP-Alexandr 1003 1 1}
2021/04/28 18:58:03 [test@MBP-Alexandr]. {test@MBP-Alexandr 1003 1 1} got message from etf.Pid{Node:"demo@MBP-Alexandr", ID:0x36, Serial:0x0, Creation:0x2}
2021/04/28 18:58:03 GLOBAL_NAME_SERVER: HandleCast: etf.Tuple{"init_connect", etf.Tuple{5, -576460752303423488}, "demo@MBP-Alexandr", etf.Tuple{"locker", "no_longer_a_pid", etf.List{}, etf.Pid{Node:"demo@MBP-Alexandr", ID:0x37, Serial:0x0, Creation:0x2}}}

Why does it happen? Can I use RPC calls?

halturin commented 3 years ago

thanks for the report. there was a little bug I've fixed in #43 .

Noksa commented 3 years ago

@halturin Thanks you!

Could you please make a new tag?

halturin commented 3 years ago

Sure, no problem.