bor icon indicating copy to clipboard operation
bor copied to clipboard

Bor cannot be gracefully shutdown when disconnected from Heimdall

Open MqllR opened this issue 2 years ago • 7 comments

System information

Tested with bor 1.1.0 and 1.2.3.

Overview of the problem

When bor is disconnected from Heimdall, it seems impossible to gracefully shutdown bor. This issue can easily led to corrupted DB (kill -9 bor generally get into "Head state missing, repairing").

Reproduction Steps

Spin up a bor instance with a wrong Heimdall URL:

docker run -it --rm 0xpolygon/bor:1.2.3 server --bor.heimdall=http://1.2.3.4:1234

Wait until the block synchronization started:

Block synchronization started

Then hit Ctrl-C or send signals:

docker exec -it <container_name> kill -INT 1
docker exec -it <container_name> kill -TERM 1

Logs / Traces / Output / Error Messages

Logs from bor after receiving an interrupt signal:

Caught signal: interrupt
Gracefully shutting down agent...
{"endpoint":"[::]:8545","lvl":"info","msg":"HTTP server stopped","t":"2024-01-25T11:51:04.015831701Z"}
{"endpoint":"[::]:8546","lvl":"info","msg":"HTTP server stopped","t":"2024-01-25T11:51:04.015918833Z"}
{"lvl":"info","msg":"IPC endpoint closed","t":"2024-01-25T11:51:04.016001352Z","url":"/data/bor.ipc"}
{"attempt":3,"lvl":"info","msg":"Retrying again in 5 seconds to fetch data from Heimdall","path":"/milestone/latest","t":"2024-01-25T11:51:08.100408984Z"}
{"attempt":3,"lvl":"info","msg":"Retrying again in 5 seconds to fetch data from Heimdall","path":"/checkpoints/latest","t":"2024-01-25T11:51:08.100450328Z"}
{"attempt":1,"error":"Get \"http://xxx/milestone/lastNoAck\": context deadline exceeded","lvl":"warn","msg":"an error while trying fetching from Heimdall","path":"/milestone/lastNoAck","t":"2024-01-25T11:51:08.100520499Z"}
{"attempt":1,"lvl":"info","msg":"Retrying again in 5 seconds to fetch data from Heimdall","path":"/milestone/lastNoAck","t":"2024-01-25T11:51:08.100554963Z"}
{"err":"context deadline exceeded","lvl":"eror","msg":"Failed to fetch latest no-ack milestone","t":"2024-01-25T11:51:08.100574545Z"}
...

MqllR avatar Jan 25 '24 13:01 MqllR

Run into the same issue several times. This is very problematic

petejkim avatar Jan 31 '24 05:01 petejkim

It shouldn't be a case, but we will check it.

VAIBHAVJINDAL3012 avatar Feb 01 '24 08:02 VAIBHAVJINDAL3012

This issue is stale because it has been open 14 days with no activity. Remove stale label or comment or this will be closed in 14 days.

github-actions[bot] avatar Feb 16 '24 00:02 github-actions[bot]

It shouldn't be a case, but we will check it.

It totally is the case. Please do not close this issue

petejkim avatar Feb 16 '24 00:02 petejkim

Experiencing the same issue

Zorato avatar Feb 22 '24 07:02 Zorato

This issue is stale because it has been open 14 days with no activity. Remove stale label or comment or this will be closed in 14 days.

github-actions[bot] avatar Mar 08 '24 00:03 github-actions[bot]

Hi, I am able to reproduce this issue locally. Will create a PR for fixing it soon (will updated here). Thanks for reporting.

manav2401 avatar Mar 16 '24 06:03 manav2401

This issue is stale because it has been open 14 days with no activity. Remove stale label or comment or this will be closed in 14 days.

github-actions[bot] avatar Mar 31 '24 00:03 github-actions[bot]

We will release it in next release.

VAIBHAVJINDAL3012 avatar Apr 04 '24 14:04 VAIBHAVJINDAL3012