Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

multi: restart LND Client on setup failure #694

Merged
4 changes: 4 additions & 0 deletions app/src/types/generated/lit-status_pb.d.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

29 changes: 28 additions & 1 deletion app/src/types/generated/lit-status_pb.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions app/src/util/tests/sampleData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1071,6 +1071,7 @@ export const litSubServerStatus: STATUS.SubServerStatusResp.AsObject = {
disabled: false,
running: true,
error: '',
customStatus: '',
},
],
[
Expand All @@ -1079,6 +1080,7 @@ export const litSubServerStatus: STATUS.SubServerStatusResp.AsObject = {
disabled: false,
running: true,
error: '',
customStatus: '',
},
],
[
Expand All @@ -1087,6 +1089,7 @@ export const litSubServerStatus: STATUS.SubServerStatusResp.AsObject = {
disabled: false,
running: true,
error: '',
customStatus: '',
},
],
[
Expand All @@ -1095,6 +1098,7 @@ export const litSubServerStatus: STATUS.SubServerStatusResp.AsObject = {
disabled: false,
running: true,
error: '',
customStatus: '',
},
],
[
Expand All @@ -1103,6 +1107,7 @@ export const litSubServerStatus: STATUS.SubServerStatusResp.AsObject = {
disabled: false,
running: true,
error: '',
customStatus: '',
},
],
[
Expand All @@ -1111,6 +1116,7 @@ export const litSubServerStatus: STATUS.SubServerStatusResp.AsObject = {
disabled: false,
running: true,
error: '',
customStatus: '',
},
],
],
Expand Down
2 changes: 1 addition & 1 deletion autopilotserverrpc/autopilotserver.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion litrpc/firewall.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion litrpc/lit-accounts.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion litrpc/lit-autopilot.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion litrpc/lit-sessions.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

49 changes: 31 additions & 18 deletions litrpc/lit-status.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions litrpc/lit-status.proto
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,9 @@ message SubServerStatus {
// error describes an error that might have resulted in the sub-server not
// starting up properly.
string error = 3;

// custom_status details a custom state that the sub-server has entered,
// which is unique to the sub-server, and which is not the standard
// disabled, running or errored state.
string custom_status = 4;
}
4 changes: 4 additions & 0 deletions litrpc/lit-status.swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,10 @@
"error": {
"type": "string",
"description": "error describes an error that might have resulted in the sub-server not\nstarting up properly."
},
"custom_status": {
"type": "string",
"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."
}
}
},
Expand Down
2 changes: 1 addition & 1 deletion litrpc/proxy.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions proto/lit-status.proto
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,9 @@ message SubServerStatus {
// error describes an error that might have resulted in the sub-server not
// starting up properly.
string error = 3;

// custom_status details a custom state that the sub-server has entered,
// which is unique to the sub-server, and which is not the standard
// disabled, running or errored state.
string custom_status = 4;
}
9 changes: 4 additions & 5 deletions rpc_proxy.go
Original file line number Diff line number Diff line change
Expand Up @@ -638,18 +638,17 @@ func (p *rpcProxy) checkSubSystemStarted(requestURI string) error {

// Check with the status manger to see if the sub-server is ready to
// handle the request.
serverStatus, err := p.statusMgr.GetStatus(system)
ready, disabled, err := p.statusMgr.IsSystemReady(system, requestURI)
guggero marked this conversation as resolved.
Show resolved Hide resolved
if err != nil {
return err
}

if serverStatus.Disabled {
if disabled {
return fmt.Errorf("%s has been disabled", system)
}

if !serverStatus.Running {
return fmt.Errorf("%s is not running: %s", system,
serverStatus.Err)
if !ready {
return fmt.Errorf("%s is not ready for: %s", system, requestURI)
}

return nil
Expand Down
Loading