mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-27 23:26:44 +00:00
This commit fixes the hang seen sometimes while doing the state sync. The cause of the hang was a rare combination of events: request state data from peer, peer drops and reconnects almost immediately. This caused a new download task to be assigned to the peer, overwriting the old one still waiting for a timeout, which in turned leaked the requests out, never to be retried. The fix is to ensure that a task assignment moves any pending one back into the retry queue. The commit also fixes a regression with peer dropping due to stalls. The current code considered a peer stalling if they timed out delivering 1 item. However, the downloader never requests only one, the minimum is 2 (attempt to fine tune estimated latency/bandwidth). The fix is simply to drop if a timeout is detected at 2 items. Apart from the above bugfixes, the commit contains some code polishes I made while debugging the hang. |
||
|---|---|---|
| .. | ||
| downloader | ||
| fetcher | ||
| filters | ||
| gasprice | ||
| api.go | ||
| api_backend.go | ||
| api_test.go | ||
| backend.go | ||
| backend_test.go | ||
| bind.go | ||
| config.go | ||
| db_upgrade.go | ||
| gen_config.go | ||
| handler.go | ||
| handler_test.go | ||
| helper_test.go | ||
| metrics.go | ||
| peer.go | ||
| protocol.go | ||
| protocol_test.go | ||
| sync.go | ||
| sync_test.go | ||