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
if (scannedStore.existsOrError(storeItem))
{
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
+ " = true.");
sb.append(" File "
......
......@@ -475,7 +475,11 @@ public class DataSetStorageAlgorithmRunner<T extends DataSetInformation>
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);
rollbackDelegate.didRollbackStorageAlgorithmRunner(this, ex,
ErrorType.OPENBIS_REGISTRATION_FAILURE);
......@@ -576,8 +580,10 @@ public class DataSetStorageAlgorithmRunner<T extends DataSetInformation>
{
result = registerData(registrationId, registrationData);
}
dssRegistrationLog.log("Data has been registered with the openBIS Application Server.");
if (result)
{
dssRegistrationLog.log("Data has been registered with the openBIS Application Server.");
}
return result;
}
......@@ -621,6 +627,14 @@ public class DataSetStorageAlgorithmRunner<T extends DataSetInformation>
applicationServerRegistrator.registerDataSetsInApplicationServer(
registrationId, registrationData);
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)
{
operationLog.error("Error in registrating data in application server",
......@@ -753,8 +767,12 @@ public class DataSetStorageAlgorithmRunner<T extends DataSetInformation>
private void rollbackStorageProcessors(Throwable ex)
{
operationLog.error(
"Error during dataset registration: " + ExceptionUtils.getRootCauseMessage(ex), ex);
if (false == ex instanceof IncomingFileDeletedBeforeRegistrationException)
{
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
// 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
public void didRollbackStorageAlgorithmRunner(DataSetStorageAlgorithmRunner<T> algorithm,
Throwable ex, ErrorType errorType)
{
operationLog.error("The error ", ex);
if (false == ex instanceof IncomingFileDeletedBeforeRegistrationException)
{
// 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;
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