-
Notifications
You must be signed in to change notification settings - Fork 38.6k
Closed
Closed
Copy link
Labels
in: coreIssues in core modules (aop, beans, core, context, expression)Issues in core modules (aop, beans, core, context, expression)type: bugA general bugA general bug
Milestone
Description
Antonio Parolini opened SPR-12797 and commented
In class AsyncExecutionAspectSupport
, line 171:
The check to see if the method return type is of type Futur and descendants is inverted. It dosen't rethrow the original exception in case of ListenableFuture
It should be
if (Future.class.isAssignableFrom(method.getReturnType())) {
Exemple code when using ListenableFuture with asyc:
@Async((Application.MASS_THREAD_EXECUTOR))
public ListenableFuture<ImportJob> importOneJobMassAsync(ImportJob importJob, UTILSessionData sessionData) {
//throw new IllegalArgumentException("test execption");
importPartialData(importJob, sessionData);
return new AsyncResult<>(importJob);
}
futur.addCallback(
new ListenableFutureCallback<ImportJob>() {
/**
* On success is called also when we cancel the execussion pool
* But Import Job will be null
*/
@Override
public void onSuccess(ImportJob importJob) {
UTILLog.logInfo(this.getClass().getName(), "futur.get finished");
}
/**
* This is called only when the job has been canceled
* @param ex
*/
@Override
public void onFailure(Throwable ex) {
UTILLog.logError(this.getClass().getName(), "Job in error:" + ex.getMessage(), ex);
}
});
Affects: 4.1.5
Attachments:
- AsyncExecutionAspectSupport.java (8.01 kB)
Issue Links:
- UncaughtExceptionHandler is not configured with AspectJ [SPR-12090] #16706 UncaughtExceptionHandler is not configured with AspectJ
Metadata
Metadata
Assignees
Labels
in: coreIssues in core modules (aop, beans, core, context, expression)Issues in core modules (aop, beans, core, context, expression)type: bugA general bugA general bug