diff --git a/src/main/java/org/dataone/cn/indexer/object/ObjectManager.java b/src/main/java/org/dataone/cn/indexer/object/ObjectManager.java index 3a60003a..f897903f 100644 --- a/src/main/java/org/dataone/cn/indexer/object/ObjectManager.java +++ b/src/main/java/org/dataone/cn/indexer/object/ObjectManager.java @@ -184,7 +184,22 @@ public SystemMetadata getSystemMetadata(String id, String relativeObjPath) throw Identifier identifier = new Identifier(); identifier.setValue(id); try { - sysmeta = d1Node.getSystemMetadata(session, identifier); + for (int i=0; i<5; i++) { + try { + sysmeta = d1Node.getSystemMetadata(session, identifier); + break; + } catch (ServiceFailure ee) { + logger.warn("The DataONE api call doesn't get the system metadata since " + + ee.getMessage() + ". This is " + i + + " try and Indexer will try again."); + try { + Thread.sleep(300); + } catch (InterruptedException ie) { + logger.info("The sleep of the thread was interrupted."); + } + continue; + } + } logger.debug("ObjectManager.getSystemMetadata - finish getting the system metadata via the DataONE API call for the pid " + id); } catch (NotAuthorized e) { logger.info("ObjectManager.getSystemMetadata - failed to get the system metadata via the DataONE API call for the pid " + id +