Skip to content

Commit ee69bbd

Browse files
authored
Merge pull request #694 from ViktorTigerstrom/2023-11-restart-lndclient-on-failure
multi: restart LND Client on setup failure
2 parents c757746 + fcd22a7 commit ee69bbd

16 files changed

+319
-103
lines changed

app/src/types/generated/lit-status_pb.d.ts

+4
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

app/src/types/generated/lit-status_pb.js

+28-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

app/src/util/tests/sampleData.ts

+6
Original file line numberDiff line numberDiff line change
@@ -1071,6 +1071,7 @@ export const litSubServerStatus: STATUS.SubServerStatusResp.AsObject = {
10711071
disabled: false,
10721072
running: true,
10731073
error: '',
1074+
customStatus: '',
10741075
},
10751076
],
10761077
[
@@ -1079,6 +1080,7 @@ export const litSubServerStatus: STATUS.SubServerStatusResp.AsObject = {
10791080
disabled: false,
10801081
running: true,
10811082
error: '',
1083+
customStatus: '',
10821084
},
10831085
],
10841086
[
@@ -1087,6 +1089,7 @@ export const litSubServerStatus: STATUS.SubServerStatusResp.AsObject = {
10871089
disabled: false,
10881090
running: true,
10891091
error: '',
1092+
customStatus: '',
10901093
},
10911094
],
10921095
[
@@ -1095,6 +1098,7 @@ export const litSubServerStatus: STATUS.SubServerStatusResp.AsObject = {
10951098
disabled: false,
10961099
running: true,
10971100
error: '',
1101+
customStatus: '',
10981102
},
10991103
],
11001104
[
@@ -1103,6 +1107,7 @@ export const litSubServerStatus: STATUS.SubServerStatusResp.AsObject = {
11031107
disabled: false,
11041108
running: true,
11051109
error: '',
1110+
customStatus: '',
11061111
},
11071112
],
11081113
[
@@ -1111,6 +1116,7 @@ export const litSubServerStatus: STATUS.SubServerStatusResp.AsObject = {
11111116
disabled: false,
11121117
running: true,
11131118
error: '',
1119+
customStatus: '',
11141120
},
11151121
],
11161122
],

autopilotserverrpc/autopilotserver.pb.go

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

litrpc/firewall.pb.go

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

litrpc/lit-accounts.pb.go

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

litrpc/lit-autopilot.pb.go

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

litrpc/lit-sessions.pb.go

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

litrpc/lit-status.pb.go

+31-18
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

litrpc/lit-status.proto

+5
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,9 @@ message SubServerStatus {
2828
// error describes an error that might have resulted in the sub-server not
2929
// starting up properly.
3030
string error = 3;
31+
32+
// custom_status details a custom state that the sub-server has entered,
33+
// which is unique to the sub-server, and which is not the standard
34+
// disabled, running or errored state.
35+
string custom_status = 4;
3136
}

litrpc/lit-status.swagger.json

+4
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,10 @@
5454
"error": {
5555
"type": "string",
5656
"description": "error describes an error that might have resulted in the sub-server not\nstarting up properly."
57+
},
58+
"custom_status": {
59+
"type": "string",
60+
"description": "custom_status details a custom state that the sub-server has entered,\nwhich is unique to the sub-server, and which is not the standard\ndisabled, running or errored state."
5761
}
5862
}
5963
},

litrpc/proxy.pb.go

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

proto/lit-status.proto

+5
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,9 @@ message SubServerStatus {
2828
// error describes an error that might have resulted in the sub-server not
2929
// starting up properly.
3030
string error = 3;
31+
32+
// custom_status details a custom state that the sub-server has entered,
33+
// which is unique to the sub-server, and which is not the standard
34+
// disabled, running or errored state.
35+
string custom_status = 4;
3136
}

rpc_proxy.go

+4-5
Original file line numberDiff line numberDiff line change
@@ -638,18 +638,17 @@ func (p *rpcProxy) checkSubSystemStarted(requestURI string) error {
638638

639639
// Check with the status manger to see if the sub-server is ready to
640640
// handle the request.
641-
serverStatus, err := p.statusMgr.GetStatus(system)
641+
ready, disabled, err := p.statusMgr.IsSystemReady(system, requestURI)
642642
if err != nil {
643643
return err
644644
}
645645

646-
if serverStatus.Disabled {
646+
if disabled {
647647
return fmt.Errorf("%s has been disabled", system)
648648
}
649649

650-
if !serverStatus.Running {
651-
return fmt.Errorf("%s is not running: %s", system,
652-
serverStatus.Err)
650+
if !ready {
651+
return fmt.Errorf("%s is not ready for: %s", system, requestURI)
653652
}
654653

655654
return nil

0 commit comments

Comments
 (0)