- 
                Notifications
    
You must be signed in to change notification settings  - Fork 38.8k
 
Description
Scott Feldstein opened SPR-13785 and commented
There is a problem in AsyncRestTemplate where it does not consistently propagate an exception up the stack from the error callback.
I am attaching code to reproduce the issue.
Import the spring starter project into STS and then run the AsyncrestremplatebugApplicationTests.
The test method bug() will fail while the test method works() will pass. The only difference btwn the methods is that there is a sleep in the works() method. The sleep allows the rest call time to fail so the subsequent call to future.get() will immediately call the error callback.
In the bug() method the rest call does not complete before the error callback is added and therefore it fails. I used Thread.sleep() in my Controller to ensure that the callbacks are added before the rest call is completed.
I would expect the same the exception from the failure callback would be consistently thrown.
Affects: 4.1.6, 4.2.3
Attachments:
- asyncrestremplatebug.tgz (53.44 kB)
 
Issue Links:
- AsyncResult calls SuccessCallback when it should call FailureCallback [SPR-14249] #18822 AsyncResult calls SuccessCallback when it should call FailureCallback