Skip to content
Snippets Groups Projects
Commit 5bf801a7 authored by cramakri's avatar cramakri
Browse files

BIS-129 SP-209 : Improve text and formatting of log messages. Surpress...

BIS-129 SP-209 : Improve text and formatting of log messages. Surpress unnecessary logging. Ensure rollback of work when no metadata is registered because the file was deleted

SVN: 26173
parent cbeb7eea
No related branches found
No related tags found
No related merge requests found
...@@ -610,7 +610,7 @@ public final class ETLDaemon ...@@ -610,7 +610,7 @@ public final class ETLDaemon
if (scannedStore.existsOrError(storeItem)) if (scannedStore.existsOrError(storeItem))
{ {
StringBuffer sb = new StringBuffer(); StringBuffer sb = new StringBuffer();
sb.append("The thread configuration setting" sb.append("The thread configuration setting "
+ ch.systemsx.cisd.etlserver.ThreadParameters.REPROCESS_FAULTY_DATASETS_NAME + ch.systemsx.cisd.etlserver.ThreadParameters.REPROCESS_FAULTY_DATASETS_NAME
+ " = true."); + " = true.");
sb.append(" File " sb.append(" File "
......
...@@ -475,7 +475,11 @@ public class DataSetStorageAlgorithmRunner<T extends DataSetInformation> ...@@ -475,7 +475,11 @@ public class DataSetStorageAlgorithmRunner<T extends DataSetInformation>
private void rollbackDuringMetadataRegistration(Throwable ex) private void rollbackDuringMetadataRegistration(Throwable ex)
{ {
operationLog.error("Failed to register metadata", ex); if (false == ex instanceof IncomingFileDeletedBeforeRegistrationException)
{
// Don't log if the file was deleted before registration, we already know.
operationLog.error("Failed to register metadata", ex);
}
rollbackStorageProcessors(ex); rollbackStorageProcessors(ex);
rollbackDelegate.didRollbackStorageAlgorithmRunner(this, ex, rollbackDelegate.didRollbackStorageAlgorithmRunner(this, ex,
ErrorType.OPENBIS_REGISTRATION_FAILURE); ErrorType.OPENBIS_REGISTRATION_FAILURE);
...@@ -576,8 +580,10 @@ public class DataSetStorageAlgorithmRunner<T extends DataSetInformation> ...@@ -576,8 +580,10 @@ public class DataSetStorageAlgorithmRunner<T extends DataSetInformation>
{ {
result = registerData(registrationId, registrationData); result = registerData(registrationId, registrationData);
} }
if (result)
dssRegistrationLog.log("Data has been registered with the openBIS Application Server."); {
dssRegistrationLog.log("Data has been registered with the openBIS Application Server.");
}
return result; return result;
} }
...@@ -621,6 +627,14 @@ public class DataSetStorageAlgorithmRunner<T extends DataSetInformation> ...@@ -621,6 +627,14 @@ public class DataSetStorageAlgorithmRunner<T extends DataSetInformation>
applicationServerRegistrator.registerDataSetsInApplicationServer( applicationServerRegistrator.registerDataSetsInApplicationServer(
registrationId, registrationData); registrationId, registrationData);
return true; return true;
} catch (IncomingFileDeletedBeforeRegistrationException e)
{
operationLog
.warn("The incoming file was deleted before registration. Nothing was registered in openBIS.");
dssRegistrationLog
.log("The incoming file was deleted before registration. Nothing was registered in openBIS.");
rollbackDuringMetadataRegistration(e);
return false;
} catch (final Throwable exception) } catch (final Throwable exception)
{ {
operationLog.error("Error in registrating data in application server", operationLog.error("Error in registrating data in application server",
...@@ -753,8 +767,12 @@ public class DataSetStorageAlgorithmRunner<T extends DataSetInformation> ...@@ -753,8 +767,12 @@ public class DataSetStorageAlgorithmRunner<T extends DataSetInformation>
private void rollbackStorageProcessors(Throwable ex) private void rollbackStorageProcessors(Throwable ex)
{ {
operationLog.error( if (false == ex instanceof IncomingFileDeletedBeforeRegistrationException)
"Error during dataset registration: " + ExceptionUtils.getRootCauseMessage(ex), ex); {
operationLog.error(
"Error during dataset registration: " + ExceptionUtils.getRootCauseMessage(ex),
ex);
}
// Errors which are not AssertionErrors leave the system in a state that we don't // Errors which are not AssertionErrors leave the system in a state that we don't
// know and can't trust. Thus we will not perform any operations any more in this // know and can't trust. Thus we will not perform any operations any more in this
......
...@@ -504,8 +504,11 @@ public class DataSetRegistrationTransaction<T extends DataSetInformation> implem ...@@ -504,8 +504,11 @@ public class DataSetRegistrationTransaction<T extends DataSetInformation> implem
public void didRollbackStorageAlgorithmRunner(DataSetStorageAlgorithmRunner<T> algorithm, public void didRollbackStorageAlgorithmRunner(DataSetStorageAlgorithmRunner<T> algorithm,
Throwable ex, ErrorType errorType) Throwable ex, ErrorType errorType)
{ {
if (false == ex instanceof IncomingFileDeletedBeforeRegistrationException)
operationLog.error("The error ", ex); {
// Don't log if the file was deleted before registration, we already know.
operationLog.error("The error ", ex);
}
boolean useAutoRecovery = autoRecoverySettings == AutoRecoverySettings.USE_AUTO_RECOVERY; boolean useAutoRecovery = autoRecoverySettings == AutoRecoverySettings.USE_AUTO_RECOVERY;
IDataSetStorageRecoveryManager storageRecoveryManager = IDataSetStorageRecoveryManager storageRecoveryManager =
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment