aeternity / aestratum_client

Stratum client
5 stars 1 forks source link

Client does not reconnect if connection is dropped #15

Open dincho opened 2 years ago

dincho commented 2 years ago
2022-06-22 08:42:13.088 [info] <0.357.0>@aestratum_client_session:send_submit_req:357 send_submit_req, req: #{id => 11,job_id => <<"8c8fd01f27ec9e33">>,method => submit,miner_nonce => <<"79e43ae8">>,pow => [2343733,55559866,60762063,63005628,68805296,73837594,73883024,90195848,90256990,98244868,101139804,133760858,136573988,146109629,147048387,148047333,151782283,160490934,181540710,194232455,201513516,204242753,224942159,255571788,260056620,260546259,262686728,273690527,292152139,303144127,351129078,373831265,410739467,412639743,413896666,434117586,448131577,449021640,454609344,501821302,526357123,533796639],type => req,user => {<<"ak_2KhKCYSVafsVaj3PBnLQDYssyXWFToRThgmi1Qtk376q9rkKZ3">>,<<"dincho1">>}}
2022-06-22 08:42:13.090 [info] <0.357.0>@aestratum_client_session:recv_rsp:216 recv_submit_rsp, rsp: #{id => 11,method => submit,result => true,type => rsp}
2022-06-22 08:43:42.188 [warning] <0.357.0>@aestratum_client_handler:handle_socket_close:115 socket_close
2022-06-22 08:43:42.188 [critical] <0.357.0>@aestratum_client_session:close_session:376 close_session
dincho commented 2 years ago

or maybe not:

1> 08:43:42.191 [error] Supervisor aestratum_client_sup had child aestratum_client_handler started with aestratum_client_handler:start_link(#{conn_cfg => #{host => <<"13.53.161.215">>,port => 9999,req_retries => 3,req_timeout => 15000,...},...}) at <0.357.0> exit with reason normal in context child_terminated
08:43:42.192 [error] Supervisor aestratum_client_sup had child aestratum_client_handler started with aestratum_client_handler:start_link(#{conn_cfg => #{host => <<"13.53.161.215">>,port => 9999,req_retries => 3,req_timeout => 15000,...},...}) at <0.357.0> exit with reason no match of right hand value {error,econnrefused} in aestratum_client_handler:init/1 line 66 in context start_error
08:43:42.192 [error] Supervisor aestratum_client_sup had child aestratum_client_handler started with aestratum_client_handler:start_link(#{conn_cfg => #{host => <<"13.53.161.215">>,port => 9999,req_retries => 3,req_timeout => 15000,...},...}) at {restarting,<0.357.0>} exit with reason reached_max_restart_intensity in context shutdown
08:43:42.192 [error] CRASH REPORT Process <0.404.0> with 0 neighbours crashed with reason: no match of right hand value {error,econnrefused} in aestratum_client_handler:init/1 line 66
08:43:42.192 [info] Application aestratum_client exited with reason: shutdown

However, retries are run without any delay which effectively defeats its purpose