nearcore icon indicating copy to clipboard operation
nearcore copied to clipboard

test_block_sync is flaky

Open Longarithm opened this issue 3 years ago • 3 comments

If I run this test multiple times, result may be either pass or fail: https://near.zulipchat.com/#narrow/stream/295558-pagoda.2Fcore/topic/test_block_sync.20flaky.3F/near/292419577

Buildkite example https://buildkite.com/nearprotocol/nearcore/builds/18839#0182832c-ef40-4dca-a31c-040429f68b05

cc @mzhangmzz

Longarithm avatar Aug 09 '22 18:08 Longarithm

I'll look into this

matklad avatar Aug 11 '22 14:08 matklad

Seems like a legit perf bug in check_known function:

https://github.com/near/nearcore/blob/73fb438331cfcde897e42272d6da3ab22596ee05/chain/chain/src/chain.rs#L389-L410

With async block processing, there's one more place where a known block could be -- in blocks in processing pool.

So, what happens here is that sync can request a block which we are already processing.

matklad avatar Aug 16 '22 17:08 matklad

Ah that makes a lot of sense!

mzhangmzz avatar Aug 16 '22 17:08 mzhangmzz