ExchangeUnion / xud

Exchange Union Daemon 🔁 ⚡️
https://exchangeunion.com
GNU Affero General Public License v3.0
115 stars 49 forks source link

fix: graceful shutdown #1994

Closed LePremierHomme closed 3 years ago

LePremierHomme commented 3 years ago

An attempt to solve https://github.com/ExchangeUnion/xud/issues/1668.

Various fixes were made to prevent delays in shutdown:

Pending swaps are still expected to (intentionally) cause delay in shutdown. There might be other issues which cause a delay which I haven't encountered. So any help in testing would be appriciated. Please paste your logs here (even if it works).

To launch via xud-docker:

$ bash ~/xud.sh -b fix_shutdown
kilrau commented 3 years ago

Fix is in, could you give this another look? @sangaman

rsercano commented 3 years ago

Another case (don't know if we want to stay it like this) is that somebody calling streamorders or new stream grpc call subscribe alerts (https://github.com/ExchangeUnion/xud/pull/1984) then unless stream is closed xud is not being closed.

Ignore if this's intentional.

kilrau commented 3 years ago

I think we should to close streams as part of the shutdown procedure. If that's not the case, want to take care of it as a separate PR? @rsercano

rsercano commented 3 years ago

I think we should to close streams as part of the shutdown procedure. If that's not the case, want to take care of it as a separate PR? @rsercano

Sure as long as @LePremierHomme doesn't want to address it, I can check too.

kilrau commented 3 years ago

Definitely not as part of this PR, so go ahead :+1:

rsercano commented 3 years ago

Definitely not as part of this PR, so go ahead 👍

After digging into this, I realized this has already been addressed for streamorders and my bad not to handle on subscribealerts by adding stream to current list, Im now adding it and should be handled on close.