cothority icon indicating copy to clipboard operation
cothority copied to clipboard

long running transaction can block processing

Open jeffallen opened this issue 6 years ago • 3 comments

in service_test.go, make slowContractFunc sleep for testInterval/2. In that case, every time it is pre-run to try to put it into a block, it will fail to get into the block, resulting in "Got more transactions than what I can do in half the blockInterval".

On the next attempt to create a block, the same transaction will use up the whole time again, and no other transactions will be taken.

jeffallen avatar Jul 23 '18 12:07 jeffallen

I see two possibilities:

  1. we simply add the last transaction, even if it goes over the time-budget
  2. if it is only one transaction, and it is over the time budget, silently discard it from the input buffer

I have a preference for 2.

ineiti avatar Aug 07 '18 08:08 ineiti

Discarding transactions is not currently possible with createStateChanges, see #1409 for notes on how this has to be attacked.

jeffallen avatar Sep 12 '18 11:09 jeffallen

I see two possibilities:

1. we simply add the last transaction, even if it goes over the time-budget

2. if it is only one transaction, and it is over the time budget, silently discard it from the input buffer

I have a preference for 2.

Either way it's the leader that decides the time budget with s.createStateChanges(..., blockinterval/2) hence which transactions to include. The followers do not check, they use noTimeout as the time budget. I think it's safe to say any changes to how to leader decides which transactions to include is backward-compatible, so we'll move this issue after v3.

kc1212 avatar Feb 04 '19 13:02 kc1212