diff --git a/elide-async/src/main/java/com/yahoo/elide/async/operation/AsyncAPIUpdateOperation.java b/elide-async/src/main/java/com/yahoo/elide/async/operation/AsyncAPIUpdateOperation.java index 0fd507d34b..dda12591ee 100644 --- a/elide-async/src/main/java/com/yahoo/elide/async/operation/AsyncAPIUpdateOperation.java +++ b/elide-async/src/main/java/com/yahoo/elide/async/operation/AsyncAPIUpdateOperation.java @@ -40,10 +40,11 @@ public void run() { asyncAPIDao.updateAsyncAPIResult(queryResultObj, queryObj.getId(), queryObj.getClass()); } catch (InterruptedException e) { - log.error("InterruptedException: {}", e); + Thread.currentThread().interrupt(); + log.error("InterruptedException: {}", e.toString()); asyncAPIDao.updateStatus(queryObj.getId(), QueryStatus.FAILURE, queryObj.getClass()); } catch (Exception e) { - log.error("Exception: {}", e); + log.error("Exception: {}", e.toString()); asyncAPIDao.updateStatus(queryObj.getId(), QueryStatus.FAILURE, queryObj.getClass()); } } diff --git a/elide-async/src/main/java/com/yahoo/elide/async/service/AsyncExecutorService.java b/elide-async/src/main/java/com/yahoo/elide/async/service/AsyncExecutorService.java index 85a46edfb7..71e6909b85 100644 --- a/elide-async/src/main/java/com/yahoo/elide/async/service/AsyncExecutorService.java +++ b/elide-async/src/main/java/com/yahoo/elide/async/service/AsyncExecutorService.java @@ -87,16 +87,17 @@ public void executeQuery(AsyncAPI queryObj, Callable callable) { queryObj.setStatus(QueryStatus.COMPLETE); queryObj.setUpdatedOn(new Date()); } catch (InterruptedException e) { - log.error("InterruptedException: {}", e); + Thread.currentThread().interrupt(); + log.error("InterruptedException: {}", e.toString()); queryObj.setStatus(QueryStatus.FAILURE); } catch (ExecutionException e) { - log.error("ExecutionException: {}", e); + log.error("ExecutionException: {}", e.toString()); queryObj.setStatus(QueryStatus.FAILURE); } catch (TimeoutException e) { - log.error("TimeoutException: {}", e); + log.error("TimeoutException: {}", e.toString()); resultFuture.setSynchronousTimeout(true); } catch (Exception e) { - log.error("Exception: {}", e); + log.error("Exception: {}", e.toString()); queryObj.setStatus(QueryStatus.FAILURE); } finally { asyncResultFutureThreadLocal.set(resultFuture); diff --git a/elide-async/src/main/java/com/yahoo/elide/async/service/dao/DefaultAsyncAPIDAO.java b/elide-async/src/main/java/com/yahoo/elide/async/service/dao/DefaultAsyncAPIDAO.java index 1b4b5462de..932c0468d2 100644 --- a/elide-async/src/main/java/com/yahoo/elide/async/service/dao/DefaultAsyncAPIDAO.java +++ b/elide-async/src/main/java/com/yahoo/elide/async/service/dao/DefaultAsyncAPIDAO.java @@ -170,7 +170,7 @@ protected Object executeInTransaction(DataStore dataStore, Transactional action) tx.flush(scope); tx.commit(scope); } catch (IOException e) { - log.error("IOException: {}", e); + log.error("IOException: {}", e.toString()); throw new IllegalStateException(e); } return result; @@ -193,7 +193,7 @@ public Iterable loadAsyncAPIByFilter(FilterExpression fi return loaded; }); } catch (Exception e) { - log.error("Exception: {}", e); + log.error("Exception: {}", e.toString()); throw new IllegalStateException(e); } return asyncAPIList; diff --git a/elide-async/src/main/java/com/yahoo/elide/async/service/thread/AsyncAPICancelRunnable.java b/elide-async/src/main/java/com/yahoo/elide/async/service/thread/AsyncAPICancelRunnable.java index ec760f83f1..1d779782d4 100644 --- a/elide-async/src/main/java/com/yahoo/elide/async/service/thread/AsyncAPICancelRunnable.java +++ b/elide-async/src/main/java/com/yahoo/elide/async/service/thread/AsyncAPICancelRunnable.java @@ -119,7 +119,7 @@ protected void cancelAsyncAPI(Class type) { type); } } catch (Exception e) { - log.error("Exception in scheduled cancellation: {}", e); + log.error("Exception in scheduled cancellation: {}", e.toString()); } } } diff --git a/elide-async/src/main/java/com/yahoo/elide/async/service/thread/AsyncAPICleanerRunnable.java b/elide-async/src/main/java/com/yahoo/elide/async/service/thread/AsyncAPICleanerRunnable.java index 04b5a18d97..e91a25f882 100644 --- a/elide-async/src/main/java/com/yahoo/elide/async/service/thread/AsyncAPICleanerRunnable.java +++ b/elide-async/src/main/java/com/yahoo/elide/async/service/thread/AsyncAPICleanerRunnable.java @@ -58,7 +58,7 @@ protected void deleteAsyncAPI(Class type) { FilterExpression fltDeleteExp = new LEPredicate(createdOnPathElement, cleanupDate); asyncAPIDao.deleteAsyncAPIAndResultByFilter(fltDeleteExp, type); } catch (Exception e) { - log.error("Exception in scheduled cleanup: {}", e); + log.error("Exception in scheduled cleanup: {}", e.toString()); } } @@ -79,7 +79,7 @@ protected void timeoutAsyncAPI(Class type) { AndFilterExpression fltTimeoutExp = new AndFilterExpression(inPredicate, lePredicate); asyncAPIDao.updateStatusAsyncAPIByFilter(fltTimeoutExp, QueryStatus.TIMEDOUT, type); } catch (Exception e) { - log.error("Exception in scheduled cleanup: {}", e); + log.error("Exception in scheduled cleanup: {}", e.toString()); } } } diff --git a/elide-core/src/main/java/com/yahoo/elide/core/dictionary/EntityPermissions.java b/elide-core/src/main/java/com/yahoo/elide/core/dictionary/EntityPermissions.java index 7dcdc8e7e8..c28bd8b37b 100644 --- a/elide-core/src/main/java/com/yahoo/elide/core/dictionary/EntityPermissions.java +++ b/elide-core/src/main/java/com/yahoo/elide/core/dictionary/EntityPermissions.java @@ -115,7 +115,7 @@ private ParseTree getPermissionExpressionTree(Class annota return parseExpression(expression); } catch (ReflectiveOperationException e) { - log.warn("Unknown permission: {}, {}", annotationClass.getName(), e); + log.warn("Unknown permission: {}, {}", annotationClass.getName(), e.toString()); throw new IllegalArgumentException("Unknown permission '" + annotationClass.getName() + "'", e); } } diff --git a/elide-integration-tests/src/test/java/com/yahoo/elide/async/integration/tests/AsyncDelayStoreTransaction.java b/elide-integration-tests/src/test/java/com/yahoo/elide/async/integration/tests/AsyncDelayStoreTransaction.java index 1156cc5233..e6cea901f6 100644 --- a/elide-integration-tests/src/test/java/com/yahoo/elide/async/integration/tests/AsyncDelayStoreTransaction.java +++ b/elide-integration-tests/src/test/java/com/yahoo/elide/async/integration/tests/AsyncDelayStoreTransaction.java @@ -35,6 +35,7 @@ public Iterable loadObjects(EntityProjection entityProjection, RequestSc Thread.sleep(Integer.parseInt(sleepTime.get(0))); } } catch (InterruptedException e) { + Thread.currentThread().interrupt(); log.debug("Test delay interrupted"); } return super.loadObjects(entityProjection, scope);