Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 331774 - Repository synchronizer should handle replication failure
Summary: Repository synchronizer should handle replication failure
Status: CLOSED FIXED
Alias: None
Product: EMF
Classification: Modeling
Component: cdo.core (show other bugs)
Version: 4.0   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Eike Stepper CLA
QA Contact: Eike Stepper CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-12-03 10:01 EST by Erwin Betschart CLA
Modified: 2011-06-23 03:39 EDT (History)
0 users

See Also:


Attachments
Triggers a new replication runnable in case of an error (2.74 KB, patch)
2010-12-03 10:05 EST, Erwin Betschart CLA
stepper: iplog+
Details | Diff
Patch v2 (3.53 KB, patch)
2010-12-23 02:01 EST, Eike Stepper CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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