Closed apotdevin closed 3 years ago
Can you tell me which subscription causes the issue? I can probably fix this if you can figure out which subscription causes it
ThunderHub is constantly polling getWalletInfo
, getClosedChannels
, getChainBalance
, getPendingChainBalance
and getChannelBalance
Since just leaving thunderhub open increases the file descriptors I'm thinking it must be one of those
What about subscriptions?
Are you recycling the lnd object or creating new lnd objects all the time?
Only using subscribeToInvoice
but this is only called at a specific point.
Ah good point, it's creating a new lnd object for each call
Yes you should re-use the LND object, let me know if that solves it
I will look into subscribeToInvoice
as well
Will give it a try, almost sure this is the issue. Thanks for the tip!
Another thing if you do recycle the LND, consider that if there is a networking error or something you may want to refresh it
And is there a correct way to deal with old lnd objects or how are this used connections closed?
And is there a correct way to deal with old lnd objects or how are this used connections closed?
I'm not sure, I would have thought that if you delete references to the grpc connection that it closes itself, but that may not be the case
I'll add a double check on the subscribe to invoice as well so that if you remove the listener it directly cancels the subscription
There is now a check on the subscribeToInvoice
method for the absence of listeners, which should now trigger a discrete cancel on the subscription
Is there a way to close previous connections that are made? Or close them after the information is received?
Theres this issue that after a while LND runs out of file descriptors and the grpc calls stop working. Referring to this issue https://github.com/apotdevin/thunderhub/issues/172