Hystrix does not terminating thread after calling fallback

108 views Asked by At

I am testing a feign client slow response using chaos monkey spring boot. Fallback is getting called and response is returned back but the method execution continues.

logger.info("Get the value from the organization ms {}",Thread.currentThread().getName());
organizationDTO = organizationRemoteData.getRemoteOrgData(organizationId); // 1
logger.info("saving data in cache {} by {}", organizationDTO,Thread.currentThread().getName());
// saving data in redis
cacheOrganizationObject(organizationDTO);
return organizationDTO;

Line number 1 is failing and fallback get called but I still see the "saving data in cache" in logs. This behavior makes the application inconsistent. is there any workaround?

Logs:

Get the value from the organization ms hystrix-organizationThreadPool-1
calling fallback method to get the organization data for id 1
saving data in cache OrganizationDTO [] by hystrix-organizationThreadPool-1
0

There are 0 answers