Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 331774

Summary: Repository synchronizer should handle replication failure
Product: [Modeling] EMF Reporter: Erwin Betschart <erwin>
Component: cdo.coreAssignee: Eike Stepper <stepper>
Status: CLOSED FIXED QA Contact: Eike Stepper <stepper>
Severity: normal    
Priority: P3    
Version: 4.0   
Target Milestone: ---   
Hardware: PC   
OS: Linux   
Whiteboard:
Attachments:
Description Flags
Triggers a new replication runnable in case of an error
stepper: iplog+
Patch v2 none

Description Erwin Betschart CLA 2010-12-03 10:01:30 EST
Build Identifier: 4.0

Bug 330906 protected the RepositorySynchronizer thread from dying but does not handle a replication failure.


I'll attach a patch...

Reproducible: Always
Comment 1 Erwin Betschart CLA 2010-12-03 10:05:04 EST
Created attachment 184470 [details]
Triggers a new replication runnable in case of an error

In case of a replication error the session is deactivated will be reconnected.
Comment 2 Eike Stepper CLA 2010-12-23 02:01:53 EST
Created attachment 185747 [details]
Patch v2
Comment 3 Eike Stepper CLA 2010-12-23 02:04:18 EST
Erwin, please confirm that:

1) The number of lines that you changed is smaller than 250.
2) You are the only author of these changed lines.
3) You apply the EPL to these changed lines.

I've changed the catch block to:

      catch (RuntimeException ex)
      {
        if (isActive())
        {
          OM.LOG.warn("Replication attempt failed. Retrying in " + retryInterval + " seconds...", ex);
          sleepRetryInterval();
        }

        disconnect();
        throw ex;
      }

But I wonder if the disconnect should be called before the sleep and if a simple return would be better than a rethrow. Thoughts?
Comment 4 Erwin Betschart CLA 2010-12-23 04:53:52 EST
I confirm to:

1) The number of lines that you changed is smaller than 250.
2) You are the only author of these changed lines.
3) You apply the EPL to these changed lines.
Comment 5 Erwin Betschart CLA 2010-12-23 04:58:15 EST
(In reply to comment #3)
> But I wonder if the disconnect should be called before the sleep and if a
> simple return would be better than a rethrow. Thoughts?

-> I don't see a problem when disconnect is called before sleep. 
-> I think a simple return instead of a rethrow is better because the exception is already logged.
Comment 6 Eike Stepper CLA 2010-12-23 08:05:17 EST
(In reply to comment #5)
> -> I don't see a problem when disconnect is called before sleep.

Oh no, at the end of disconnect() the reconnect() is triggered...

> -> I think a simple return instead of a rethrow is better because the exception is already logged.

Changed to return;

Committed to HEAD
Comment 7 Eike Stepper CLA 2011-06-23 03:39:52 EDT
Available in R20110608-1407