Ticket #2132: sl2132-reduce-_FLUSH_TIMEOUT-to-5sec.patch

File sl2132-reduce-_FLUSH_TIMEOUT-to-5sec.patch, 1.0 KB (added by bernie, 12 years ago)

Mitigate the bug by reducing the timeout

  • src/carquinyol/indexstore.py

    From 502e89cbaa313f9c03fb3908711efbe9a3a06404 Mon Sep 17 00:00:00 2001
    From: Bernie Innocenti <bernie@codewiz.org>
    Date: Mon, 2 Aug 2010 13:33:43 -0400
    Subject: [PATCH] sl#2132: reduce _FLUSH_TIMEOUT to 5 seconds
    Organization: Sugar Labs Foundation
    X-Subversion: sucks
    
    This drastically reduces the chance of data loss in the journal on
    crash or power failure.
    
    The previous timeout was set to 60 seconds. It is not clear how much
    time flushing the journal takes on an XO-1. Until we measure, 5 and 60
    are equally unjustified random numbers.
    ---
     src/carquinyol/indexstore.py |    2 +-
     1 files changed, 1 insertions(+), 1 deletions(-)
    
    diff --git a/src/carquinyol/indexstore.py b/src/carquinyol/indexstore.py
    index 5ed9a0b..cc7f755 100644
    a b _PREFIX_KEEP = 'K' 
    4444_FLUSH_THRESHOLD = 20
    4545
    4646# Force a flush after _n_ seconds since the last change to the db
    47 _FLUSH_TIMEOUT = 60
     47_FLUSH_TIMEOUT = 5
    4848
    4949_PROPERTIES_NOT_TO_INDEX = ['timestamp', 'preview']
    5050