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

chore: change the connection timeout period to 5 seconds #1098

Merged

Conversation

ice909
Copy link
Collaborator

@ice909 ice909 commented Apr 2, 2025

No description provided.

@ice909 ice909 requested a review from dengbo11 April 2, 2025 07:06
@ice909 ice909 marked this pull request as draft April 3, 2025 03:00
@ice909 ice909 removed the request for review from dengbo11 April 3, 2025 03:00
@ice909 ice909 force-pushed the chore/adjust-connect-timeout branch from e592498 to 28e0c14 Compare April 3, 2025 07:02
@ice909 ice909 changed the title chore: change the connection timeout period to 3 seconds chore: change the connection timeout period to 5 seconds Apr 3, 2025
@ice909 ice909 marked this pull request as ready for review April 3, 2025 07:02
@ice909 ice909 requested a review from Copilot April 3, 2025 07:02
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This pull request updates the connection timeout configuration by increasing the default period to 5 seconds and providing more informative error messages.

  • Updates error messages in ostree_repo.cpp to suggest adjusting the timeout for slow networks.
  • Refactors apiClient.c to dynamically set the connection timeout based on the LINGLONG_CONNECT_TIMEOUT environment variable, with a fallback default of 5 seconds.

Reviewed Changes

Copilot reviewed 2 out of 3 changed files in this pull request and generated no comments.

File Description
libs/linglong/src/linglong/repo/ostree_repo.cpp Updated error messages to guide users on modifying the connection timeout.
external/http/src/apiClient.c Introduced dynamic timeout logic with environment variable parsing and a default value of 5 seconds.
Files not reviewed (1)
  • tools/openapi-c-libcurl-client/apiClient.c.mustache: Language not supported
Comments suppressed due to low confidence (1)

external/http/src/apiClient.c:444

  • [nitpick] When LINGLONG_CONNECT_TIMEOUT is set with an invalid value, the code silently defaults to 5 seconds without notifying the user. Consider logging a warning message to aid in debugging configuration issues.
timeout = strtol(timeout_str, &endptr, 10);

@ice909 ice909 requested review from myml and dengbo11 April 3, 2025 07:03
Users can set the timeout period using environment variables `LINGLONG_CONNECT_TIMEOUT`.

Signed-off-by: ice909 <[email protected]>
@ice909 ice909 force-pushed the chore/adjust-connect-timeout branch from 28e0c14 to a4f6168 Compare April 3, 2025 07:06
@dengbo11 dengbo11 merged commit 4eaac1f into OpenAtom-Linyaps:master Apr 7, 2025
5 of 13 checks passed
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

Successfully merging this pull request may close these issues.

2 participants