Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hang on network error #89

Closed
broom9 opened this issue Aug 10, 2019 · 4 comments
Closed

Hang on network error #89

broom9 opened this issue Aug 10, 2019 · 4 comments

Comments

@broom9
Copy link

broom9 commented Aug 10, 2019

With the following codes, if the network address is unreachable (e.g. when accidentally set as undefined or some other network issues), the script hangs without throwing errors.

const axios = require('axios');
const axiosRetry = require('axios-retry');

axiosRetry(axios, {
  retries: 3,
  retryDelay: axiosRetry.exponentialDelay,
  retryCondition: error => axiosRetry.isNetworkOrIdempotentRequestError(error)
    || (error.response && error.response.status === 429),
});


axios.get('undefined/v1').then(() => {
  console.info('Successful');
}).catch((e) => {
  console.error(e);
});

axios-retry: 3.1.2
axios: 0.19.0

@hpurmann
Copy link

We're facing the same problem. It never throws an error, just hangs

@cjancsar
Copy link

With the feedback logic from #35 you can see that the retries variable seems to be ignored, and it will just perpetually retry!

@MaksimKiselev
Copy link

MaksimKiselev commented Aug 29, 2019

Since version 0.19.0 axios filter out custom properties in config , see axios/axios#164 (comment)

It means that axios-retry can't store retry number and will try retry infinite.

Workaround for this issue - downgrade to axios ^0.18.0

@mawrkus
Copy link
Contributor

mawrkus commented Oct 10, 2019

#59

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants