Store unrecoverable

This commit is contained in:
M66B 2020-10-30 12:16:49 +01:00
parent 1db59c34ac
commit ebf162070e
2 changed files with 15 additions and 2 deletions

View File

@ -4168,6 +4168,7 @@ class Core {
private Semaphore semaphore = new Semaphore(0);
private boolean running = true;
private boolean recoverable = true;
private Throwable unrecoverable = null;
private Long lastActivity = null;
private boolean process = false;
@ -4244,6 +4245,9 @@ class Core {
if (ex instanceof OperationCanceledException)
recoverable = false;
if (!recoverable)
unrecoverable = ex;
if (!backingoff) {
thread.interrupt();
yield();
@ -4297,6 +4301,10 @@ class Core {
return recoverable;
}
Throwable getUnrecoverable() {
return unrecoverable;
}
void join(Thread thread) {
boolean joined = false;
boolean interrupted = false;

View File

@ -1469,8 +1469,13 @@ public class ServiceSynchronize extends ServiceBase implements SharedPreferences
" Tune interval=" + account.poll_interval +
" idle=" + idleTime + "/" + tune);
try {
if (!state.isRecoverable())
throw new StoreClosedException(iservice.getStore(), "Unrecoverable");
if (!state.isRecoverable()) {
Throwable ex = state.getUnrecoverable();
if (ex instanceof Exception)
throw new StoreClosedException(iservice.getStore(), "Unrecoverable", (Exception) ex);
else
throw new StoreClosedException(iservice.getStore(), "Unrecoverable");
}
// Sends store NOOP
EntityLog.log(ServiceSynchronize.this, account.name + " checking store");