avoid that a system crash can cause messages to be propagated twice
fdatasync() the journal after creating the pair record and recording the TUID, but before the message propagation actually starts. all other writes to the journal are not flushed, as they will at worst cause some unnecessary network traffic without visible effect.
This commit is contained in:
parent
a326bf2f58
commit
49223b2df2
|
@ -1202,6 +1202,7 @@ box_loaded( int sts, void *aux )
|
||||||
cv->srec = srec;
|
cv->srec = srec;
|
||||||
cv->msg = tmsg;
|
cv->msg = tmsg;
|
||||||
Fprintf( svars->jfp, "# %d %d %." stringify(TUIDL) "s\n", srec->uid[M], srec->uid[S], srec->tuid );
|
Fprintf( svars->jfp, "# %d %d %." stringify(TUIDL) "s\n", srec->uid[M], srec->uid[S], srec->tuid );
|
||||||
|
fdatasync( fileno( svars->jfp ) );
|
||||||
debug( " -> %sing message, TUID %." stringify(TUIDL) "s\n", str_hl[t], srec->tuid );
|
debug( " -> %sing message, TUID %." stringify(TUIDL) "s\n", str_hl[t], srec->tuid );
|
||||||
if (copy_msg( cv ))
|
if (copy_msg( cv ))
|
||||||
return;
|
return;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user