Delete HTTP socket connection when timeout with nodeJS axios

7/27/2021

We are using a nodeJS application with axios to do HTTP queries to another nodeJS application.

Both apps are running on kubernetes, they communicate via a k8s service:

APP_A (10 pods) --(axios HTTP)--> APP_B (10 pods)

We use keep alive HTTP connections to query APP_B.

Problem

When deploying a new version of APP_B (so all pods change IP), APP_A is still sending HTTP request to .. former pods, hence we got HTTP timeout, during 20 minutes!

I would like to remove keep-alived HTTP connection when timeout occurs, it is possible?

-- Thomas Decaux
axios
kubernetes

0 Answers