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

Timeouts in operations with sockets #417

Closed
wants to merge 12 commits into from

Conversation

aritosteles
Copy link
Contributor

Related issue
157

Description

This PR adds timeouts to socket operations that can block the process/co_routine indefinitely.

  • Compilation without warnings in every supported platform
    • Linux

@aritosteles aritosteles linked an issue Dec 12, 2024 that may be closed by this pull request
4 tasks
@aritosteles aritosteles self-assigned this Dec 12, 2024
@aritosteles aritosteles force-pushed the enhancement/157-improve-error-handling branch 4 times, most recently from 30f920d to 83e4230 Compare December 12, 2024 22:02
@aritosteles aritosteles force-pushed the enhancement/157-improve-error-handling branch 9 times, most recently from 615308d to cecad10 Compare December 17, 2024 19:31
@aritosteles aritosteles requested review from TomasTurina and removed request for sdvendramini December 17, 2024 20:48
@jr0me jr0me force-pushed the enhancement/157-improve-error-handling branch 2 times, most recently from 438b259 to 3ef1267 Compare December 18, 2024 18:50
@aritosteles aritosteles force-pushed the enhancement/157-improve-error-handling branch from 3ef1267 to c479ce0 Compare December 18, 2024 19:12
Copy link
Member

@jr0me jr0me left a comment

Choose a reason for hiding this comment

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

I noted a few minor things to look at. I do have some doubts about passing an io_context as a parameter to methods of a class that already received one in their constructors, we should find a way to improve this. Also, if the timeout is not configurable, I would take it out from the parameters list of each method or at least, since it is always the same value, to add it as a constructor parameter or with a set method so we don't need to repeat it so much (at the moment I cannot think of a case where we want to call each method with different timeouts).

src/agent/communicator/include/http_socket.hpp Outdated Show resolved Hide resolved
src/agent/communicator/include/http_socket.hpp Outdated Show resolved Hide resolved
src/agent/communicator/include/http_socket.hpp Outdated Show resolved Hide resolved
src/agent/communicator/include/https_socket.hpp Outdated Show resolved Hide resolved
src/agent/communicator/include/https_socket.hpp Outdated Show resolved Hide resolved
src/agent/communicator/src/https_socket.cpp Outdated Show resolved Hide resolved
src/agent/communicator/src/https_socket.cpp Outdated Show resolved Hide resolved
src/agent/communicator/src/https_socket.cpp Outdated Show resolved Hide resolved
src/agent/communicator/src/https_socket.cpp Outdated Show resolved Hide resolved
src/agent/communicator/tests/CMakeLists.txt Outdated Show resolved Hide resolved
@aritosteles aritosteles force-pushed the enhancement/157-improve-error-handling branch 2 times, most recently from a7b2840 to 99e5f33 Compare December 19, 2024 16:31
@aritosteles aritosteles force-pushed the enhancement/157-improve-error-handling branch 3 times, most recently from a790555 to 240667e Compare December 26, 2024 21:54
@aritosteles aritosteles force-pushed the enhancement/157-improve-error-handling branch 4 times, most recently from 7b54435 to 4338db6 Compare December 27, 2024 20:39
@aritosteles aritosteles force-pushed the enhancement/157-improve-error-handling branch from 4338db6 to bc2cbee Compare December 30, 2024 20:17
@TomasTurina TomasTurina deleted the enhancement/157-improve-error-handling branch December 31, 2024 13:39
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.

Improve error handling in network functions
3 participants