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

fix: do not return LNClient while shutting down #600

Closed
wants to merge 1 commit into from

Conversation

im-adithya
Copy link
Member

Fixes #391 - This issue is actually because migrate node is not working and is giving the user a 0-byte file, hence resulting in an EOF error while reading

Description

Sometimes during backup, calls to get the LNClient information are invoked (not exactly sure why, but it happens randomly), in between the LNClient stop process (see screenshot where calls to get node info and channels are requested between LDK shutdown initiation and complete) which causes the app to panic, this PR adds an isLNClientShuttingDown var so that GetLNClient returns nil without making calls to LDK during shutdown.

Screenshot 2024-09-03 at 10 15 45 PM

@@ -17,7 +17,11 @@ func (svc *service) StopApp() {
}

func (svc *service) stopLNClient() {
defer svc.wg.Done()
svc.isLNClientShuttingDown = true
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe we can do

lnClient := svc.lnClient
svc.lnClient = nil

and proceed to shut down lnClient

@rolznz rolznz added this to the v1.7.0 milestone Sep 3, 2024
@@ -234,6 +234,9 @@ func (svc *service) GetEventPublisher() events.EventPublisher {
}

func (svc *service) GetLNClient() lnclient.LNClient {
if svc.isLNClientShuttingDown {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this LNClient specific? or can it be a global boolean indicating the shutdown?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I do not think we need one. See #605

@rolznz
Copy link
Contributor

rolznz commented Sep 4, 2024

Closing in favor of #605

@rolznz rolznz closed this Sep 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Restore backup on Mac Desktop does not work
3 participants