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

feat: Add request_timeout, a parameter as optional to cluster::request() which allows user to set http_client::timeout and add error message for request timeouts #1186

Merged
merged 3 commits into from
Jul 6, 2024

Conversation

sony-string
Copy link
Contributor

@sony-string sony-string commented Jul 3, 2024

At now, cluster::request can't accept HTTP requests that require a long time to wait for response, especially which takes over 5 seconds. That's because there's no option to set http_client::timeout as user want. So, I added the optional parameter request_timeout to set it.

When an user calls cluster::request(), It would be passed through cluster::request() -> http_request::request_timeout (what I added in this commit) -> http_client::timeout

And also, http_request::run is printing Malformed HTTP response when request has timed out, so I fix it to print a log "Timed out while waiting for the response". For this, I needed to add a public member variable to http_client, timed_out which would be set by https_client::one_second_timer()

Code change checklist

  • I have ensured that all methods and functions are fully documented using doxygen style comments.
  • My code follows the coding style guide.
  • I tested that my change works before raising the PR.
  • I have ensured that I did not break any existing API calls.
  • I have not built my pull request using AI, a static analysis tool or similar without any human oversight.

@CLAassistant
Copy link

CLAassistant commented Jul 3, 2024

CLA assistant check
All committers have signed the CLA.

@github-actions github-actions bot added documentation Improvements or additions to documentation build Issue or Pull Request related to the build process code Improvements or additions to code. labels Jul 3, 2024
Copy link

netlify bot commented Jul 3, 2024

Deploy Preview for dpp-dev ready!

Name Link
🔨 Latest commit b61522d
🔍 Latest deploy log https://app.netlify.com/sites/dpp-dev/deploys/668541dcadc549000892f7ff
😎 Deploy Preview https://deploy-preview-1186--dpp-dev.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@braindigitalis braindigitalis merged commit 47d420f into brainboxdotcc:dev Jul 6, 2024
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build Issue or Pull Request related to the build process code Improvements or additions to code. documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants