forked from TrueCloudLab/frostfs-node
[#1208] innerring: Fix race condition between handling new epoch and block
Before resetting the timer, ensure the block tick is processed. Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>
This commit is contained in:
parent
4770cb8bf6
commit
e8bf18c0b4
5 changed files with 59 additions and 3 deletions
|
@ -23,7 +23,15 @@ func (np *Processor) processNewEpoch(ev netmapEvent.NewEpoch) {
|
|||
}
|
||||
|
||||
np.epochState.SetEpochCounter(epoch)
|
||||
if err := np.epochTimer.ResetEpochTimer(); err != nil {
|
||||
|
||||
h, err := np.netmapClient.Morph().TxHeight(ev.TxHash())
|
||||
if err != nil {
|
||||
np.log.Warn("can't get transaction height",
|
||||
zap.String("hash", ev.TxHash().StringLE()),
|
||||
zap.String("error", err.Error()))
|
||||
}
|
||||
|
||||
if err := np.epochTimer.ResetEpochTimer(h); err != nil {
|
||||
np.log.Warn("can't reset epoch timer",
|
||||
zap.String("error", err.Error()))
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue