mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2026-12-05 18:47:20 +01:00
test(blockvolume): F1 load writer renews its NVMe/TCP deadline per command
dialNVMe sets one deadline 60 s after the dial; the F1 writer runs for F1_WRITE_SECONDS (120 by default), so the connection timed out after about 4096 writes, just as the snapshots began. Each write now gets its own 30 s deadline. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
d85aa71141
commit
d8233a99e4
1 file changed
+7
@@ -264,6 +264,10 @@ func f1Restore(t *testing.T, env *handoffEnv, src, snap, target string) *daemon
|
||||
return d
|
||||
}
|
||||
|
||||
// f1CommandDeadline bounds one load write (and its flush): a write held
|
||||
// longer than this by a cut fails the rung.
|
||||
const f1CommandDeadline = 30 * time.Second
|
||||
|
||||
// f1Block is one deterministic 4096-byte block (pattern needs a length that
|
||||
// divides 4096; these labels do not, so the block is filled explicitly).
|
||||
func f1Block(vol string, round int, kind string, lba uint64) []byte {
|
||||
@@ -328,6 +332,9 @@ func f1RunRound(t *testing.T, env *handoffEnv, cfg f1Config, vols []f1Volume, ro
|
||||
}
|
||||
lba := first + uint64(n)
|
||||
s := time.Now()
|
||||
// Per command: dialNVMe's deadline is 60 s from the dial,
|
||||
// shorter than the write period.
|
||||
_ = c.io.SetDeadline(s.Add(f1CommandDeadline))
|
||||
err := c.tryWrite(lba, f1Block(vol, round, "load", lba))
|
||||
if err == nil && n%16 == 15 {
|
||||
err = c.tryFlush()
|
||||
|
||||
Reference in new issue
Block a user