Skip to content

Commit 8d626aa

Browse files
kaleofdutyjmank88
authored andcommitted
Experimental LOOPP-enabling adjustment to MaxDurationQuery
1 parent 82b910b commit 8d626aa

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

offchainreporting2plus/internal/ocr2/protocol/report_generation_leader.go

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,13 @@ func (repgen *reportGenerationState) startRound() {
7575
repgen.leaderState.readyToStartRound = false
7676
var query types.Query
7777
{
78-
ctx, cancel := context.WithTimeout(repgen.ctx, repgen.config.MaxDurationQuery)
78+
maxDurationQuery := repgen.config.MaxDurationQuery
79+
if maxDurationQuery == 0 {
80+
// Some feeds are configured to zero due to the in-memory implementation of Query being a no-op.
81+
// This is incompatible with GRPC/LOOPPs, which short circuits on the cancelled context, so we override the value.
82+
maxDurationQuery = 100 * time.Millisecond // TODO from config?
83+
}
84+
ctx, cancel := context.WithTimeout(repgen.ctx, maxDurationQuery)
7985
defer cancel()
8086

8187
ins := loghelper.NewIfNotStopped(

0 commit comments

Comments
 (0)