mirror of
https://github.com/google/nomulus.git
synced 2025-07-23 19:20:44 +02:00
Add more logging in the event of replay put/delete failure (#1262)
* Add more logging in the event of replay put/delete failure
This commit is contained in:
parent
a369e57e5c
commit
fb002953c8
1 changed files with 31 additions and 21 deletions
|
@ -233,6 +233,7 @@ public class ReplayCommitLogsToSqlAction implements Runnable {
|
|||
|
||||
private void handleEntityPut(Entity entity) {
|
||||
Object ofyPojo = auditedOfy().toPojo(entity);
|
||||
try {
|
||||
if (ofyPojo instanceof DatastoreEntity) {
|
||||
DatastoreEntity datastoreEntity = (DatastoreEntity) ofyPojo;
|
||||
datastoreEntity
|
||||
|
@ -248,6 +249,10 @@ public class ReplayCommitLogsToSqlAction implements Runnable {
|
|||
"%s does not implement DatastoreEntity, which is necessary for SQL replay.",
|
||||
ofyPojo.getClass());
|
||||
}
|
||||
} catch (Throwable t) {
|
||||
logger.atSevere().log("Error when replaying object %s", ofyPojo);
|
||||
throw t;
|
||||
}
|
||||
}
|
||||
|
||||
private void handleEntityDelete(VersionedEntity entityToDelete) {
|
||||
|
@ -262,6 +267,7 @@ public class ReplayCommitLogsToSqlAction implements Runnable {
|
|||
"Skipping SQL delete for kind %s since it is not convertible.", key.getKind());
|
||||
return;
|
||||
}
|
||||
try {
|
||||
Class<?> entityClass = entityVKey.getKind();
|
||||
// Delete the key iff the class represents a JPA entity that is replicated
|
||||
if (!NonReplicatedEntity.class.isAssignableFrom(entityClass)
|
||||
|
@ -270,6 +276,10 @@ public class ReplayCommitLogsToSqlAction implements Runnable {
|
|||
ReplaySpecializer.beforeSqlDelete(entityVKey);
|
||||
jpaTm().delete(entityVKey);
|
||||
}
|
||||
} catch (Throwable t) {
|
||||
logger.atSevere().log("Error when deleting key %s", entityVKey);
|
||||
throw t;
|
||||
}
|
||||
}
|
||||
|
||||
private static int compareByWeight(VersionedEntity a, VersionedEntity b) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue