BBMRI-ERIC / negotiator-frontend

The BBMRI-ERIC Negotiator is a service for structured negotiation with biological resources dealing with human data and/or biological samples. The reference implementation for the frontend is available in this repository.
https://negotiator-v3.bbmri-eric.eu
4 stars 3 forks source link

fix: add axios retry,to call api again if server return error 500 #215

Closed tmilost closed 2 months ago

tmilost commented 3 months ago

fix: add axios retry, it will call api again, every 1 sec, if server return error 500 or 501

tmilost commented 3 months ago

I left only that api request for /userinfo and I still get an error from the server, then the only solution I could think of is that if it gets 500 from the server to repeat the call every second up to 5 times until it gets a response.

tmilost commented 3 months ago

I get this warning from the back end: 2024-05-27T13:47:19.887+02:00 WARN 62263 --- [Negotiator] [nio-8081-exec-1] o.s.w.s.h.HandlerMappingIntrospector : Cache miss for REQUEST dispatch to '/api/v3/userinfo' (previous null). Performing MatchableHandlerMapping lookup. This is logged once only at WARN level, and every time at TRACE.

Maybe there are some relation to this: https://stackoverflow.com/questions/77611596/cache-miss-for-request-dispatch InSpring Boot version 3.2.0, I have seen that configuring Security (mainly related to CORS) in the Spring Boot application can lead to multiple calls (around 8 to 9 times) to the getResultFor(HttpServletRequest request) method of the HandlerMappingIntrospector class. Resulting in a Cache miss for REQUEST dispatch issue and impacting performance, as indicated in this [Link](https://github.com/spring-projects/spring-framework/issues/31588#issue-1987261317).