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

litecoind keeps on exiting after restart #37

Closed
kilrau opened this issue Jun 13, 2019 · 6 comments · Fixed by #47
Closed

litecoind keeps on exiting after restart #37

kilrau opened this issue Jun 13, 2019 · 6 comments · Fixed by #47
Assignees
Labels
bug Something isn't working P1 top priority

Comments

@kilrau
Copy link
Contributor

kilrau commented Jun 13, 2019

Offshoot from #38 and reason why xud can't connect to litecoind after restart of container/machine:

  • rm -rf ~/.xud-docker/testnet/data/litecoind - resync - all is good
  • but once litecoind was stopped or the machine rebooted, litecoind container keeps on exititing because it can't read some block data
  • it looks like docker stop doesn't manage to gracefully shutdown litecoind
@kilrau kilrau added the P1 top priority label Jun 13, 2019
@kilrau kilrau changed the title litecoind keeps on exiting litecoind keeps on exiting after restart Jun 13, 2019
@kilrau kilrau added bug Something isn't working P2 mid priority and removed P1 top priority labels Jun 13, 2019
@reliveyy
Copy link
Collaborator

reliveyy commented Jun 16, 2019

https://bitcoin.stackexchange.com/questions/8787/failed-to-read-block
bitcoin/bitcoin#8081

The solution I can find is using command line option -reindex. But with this option litecoind will re-sync from the beginning. I don't think it's a good solution for users.
And I also notice that bitcoind doesn't have this broken data crashing problem.

@kilrau
Copy link
Contributor Author

kilrau commented Jun 17, 2019

I'd like to test something:

  1. delete data/litcoind, sync testnet from scratch, bash into litecoind container and shut down gracefully via rpc. Then down container.
  2. docker-compose up -d litecoind. See if it works.

@kilrau
Copy link
Contributor Author

kilrau commented Jun 17, 2019

Adding a fresh litecoind log here soon (resyncing).

@kilrau
Copy link
Contributor Author

kilrau commented Jun 17, 2019

In some tests we verified that litecoind's graceful shutdown is triggered on docker stop litecoind but looks like it doesn't finish all it has to do before docker kills. Trying stop_grace_period: 1m in docker-compose.yml .

@kilrau
Copy link
Contributor Author

kilrau commented Jun 17, 2019

Problem: host reboot or docker stop litecoind does not care about the docker-compose yml file.

Patching the entry script should be the way to go:
https://medium.com/@manish_demblani/docker-container-uncaught-kill-signal-d5ed22698293

Let's do it for all containers to be on the safe side.

@kilrau
Copy link
Contributor Author

kilrau commented Jun 19, 2019

Tested:

t0 litecoind syncing

ltc Syncing 0.83% (8347/1003999)

t1 docker stop

> docker stop 3d68ba19d202
3d68ba19d202

t2 log shows complete shutdown

litecoind_1  | Stopping PID 6
litecoind_1  | 2019-06-19T09:53:07Z tor: Thread interrupt
litecoind_1  | 2019-06-19T09:53:07Z Shutdown: In progress...
litecoind_1  | 2019-06-19T09:53:07Z torcontrol thread exit
litecoind_1  | 2019-06-19T09:53:07Z addcon thread exit
litecoind_1  | 2019-06-19T09:53:07Z opencon thread exit
litecoind_1  | 2019-06-19T09:53:07Z net thread exit
litecoind_1  | 2019-06-19T09:53:07Z msghand thread exit
litecoind_1  | 2019-06-19T09:53:07Z scheduler thread interrupt
litecoind_1  | 2019-06-19T09:53:07Z Dumped mempool: 3e-06s to copy, 0.003441s to dump
litecoind_1  | 2019-06-19T09:53:15Z Shutdown: done

t3 docker-compose up -d litecoind

Syncing continues without issues (ltc Syncing 1.45% (16220/1113654))

t4 YAY

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working P1 top priority
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants