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

Consider adding timeout to announce-shop url to prevent long timeouts #36

Open
4 tasks
chrisjsimpson opened this issue Dec 20, 2021 · 1 comment
Open
4 tasks

Comments

@chrisjsimpson
Copy link
Contributor

chrisjsimpson commented Dec 20, 2021

Is your feature request related to a problem? Please describe.

When a shop is down, then the shop announcement will fail, the announcement currently happens via a uwsgi cron(not to be confused with cron) curl request , but has no timeout so uses the default (which is?). This causes significant cpu load when shops are offline.

Describe the solution you'd like
Consider adding timeout to the curl shop announce uwsgi cron reduced, so that it fails fast.

Describe alternatives you've considered
Doing something entirely different

Additional context

  • is there a better way?
  • work out how to reduce the default connect timeout in man curl (there might be more than one e.g. connect timeout vs lookup timeout)
  • #37
  • update existing shops timeout
@chrisjsimpson chrisjsimpson transferred this issue from Subscribie/subscribie Dec 20, 2021
@elliottmotson
Copy link
Collaborator

elliottmotson commented Dec 20, 2021

Consider curl parameters
--connect-timeout parameter
-m, --max-time
From curl manpages

--connect-timeout <seconds>
    Maximum  time  in  seconds  that you allow the connection to the
    server to take.  This only limits  the  connection  phase,  once
    curl has connected this option is of no more use.  Since 7.32.0,
    this option accepts decimal values, but the actual timeout  will
    decrease in accuracy as the specified timeout increases in deci‐
    mal precision. See also the -m, --max-time option.
    If this option is used several times, the last one will be used.

-m, --max-time <seconds>
    Maximum  time  in  seconds that you allow the whole operation to
    take.  This is useful for preventing your batch jobs from  hang‐
    ing  for  hours due to slow networks or links going down.  Since
    7.32.0, this option accepts decimal values, but the actual time‐
    out will decrease in accuracy as the specified timeout increases
    in decimal precision.  See also the --connect-timeout option.

    If this option is used several times, the last one will be used.

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

No branches or pull requests

2 participants