org/sonews/daemon/NNTPConnection.java
changeset 30 146b3275b792
parent 25 dd05c3f2fa24
     1.1 --- a/org/sonews/daemon/NNTPConnection.java	Sat May 01 18:51:57 2010 +0200
     1.2 +++ b/org/sonews/daemon/NNTPConnection.java	Sun May 09 12:38:46 2010 +0200
     1.3 @@ -33,6 +33,7 @@
     1.4  import org.sonews.daemon.command.Command;
     1.5  import org.sonews.storage.Article;
     1.6  import org.sonews.storage.Channel;
     1.7 +import org.sonews.storage.StorageBackendException;
     1.8  import org.sonews.util.Log;
     1.9  import org.sonews.util.Stats;
    1.10  
    1.11 @@ -275,7 +276,17 @@
    1.12      try
    1.13      {
    1.14        // The command object will process the line we just received
    1.15 -      command.processLine(this, line, raw);
    1.16 +      try
    1.17 +      {
    1.18 +        command.processLine(this, line, raw);
    1.19 +      }
    1.20 +      catch(StorageBackendException ex)
    1.21 +      {
    1.22 +        Log.get().info("Retry command processing after StorageBackendException");
    1.23 +
    1.24 +        // Try it a second time, so that the backend has time to recover
    1.25 +        command.processLine(this, line, raw);
    1.26 +      }
    1.27      }
    1.28      catch(ClosedChannelException ex0)
    1.29      {
    1.30 @@ -289,7 +300,7 @@
    1.31          ex0a.printStackTrace();
    1.32        }
    1.33      }
    1.34 -    catch(Exception ex1)
    1.35 +    catch(Exception ex1) // This will catch a second StorageBackendException
    1.36      {
    1.37        try
    1.38        {