[hotfix] Increase retry time to avoid document conflict
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
- *
*/
package org.apache.streampipes.connect.container.master.management;
@@ -23,6 +22,7 @@ import org.apache.streampipes.connect.container.master.health.AdapterOperationLo
import org.apache.streampipes.model.connect.adapter.AdapterDescription;
import org.apache.streampipes.storage.api.IAdapterStorage;
import org.apache.streampipes.storage.couchdb.CouchDbStorageManager;
+
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -32,7 +32,7 @@ import java.util.concurrent.TimeUnit;
public class WorkerAdministrationManagement {
private static final Logger LOG = LoggerFactory.getLogger(AdapterMasterManagement.class);
- private static final int MAX_RETRIES = 3;
+ private static final int MAX_RETRIES = 7;
private final IAdapterStorage adapterDescriptionStorage;
@@ -49,9 +49,8 @@ public class WorkerAdministrationManagement {
availableAdapterDescription.forEach(adapterDescription -> {
// only install once adapter description per service group
- boolean alreadyInstalled = alreadyRegisteredAdapters
- .stream()
- .anyMatch(a -> a.getAppId().equals(adapterDescription.getAppId()));
+ boolean alreadyInstalled =
+ alreadyRegisteredAdapters.stream().anyMatch(a -> a.getAppId().equals(adapterDescription.getAppId()));
if (!alreadyInstalled) {
this.adapterDescriptionStorage.storeAdapter(adapterDescription);
}
@@ -64,9 +63,9 @@ public class WorkerAdministrationManagement {
private void checkAndRestore(int retryCount) {
if (AdapterOperationLock.INSTANCE.isLocked()) {
LOG.info("Adapter operation already in progress, {}/{}", (retryCount + 1), MAX_RETRIES);
- if (retryCount < MAX_RETRIES) {
+ if (retryCount <= MAX_RETRIES) {
try {
- TimeUnit.MILLISECONDS.sleep(1000);
+ TimeUnit.MILLISECONDS.sleep(3000);
retryCount++;
checkAndRestore(retryCount);
} catch (InterruptedException e) {
