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

Standardize error response in three request handlers #1544

Merged

Conversation

nichamon
Copy link
Collaborator

@nichamon nichamon commented Dec 3, 2024

Modify updtr_task, prdcr_hint, and set_route handlers to use ldmsd_send_req_response() for sending error messages back to requesters. This function automatically handles message length calculation, removing the need for manual length calculations in these handlers.

@nichamon nichamon requested a review from tom95858 December 3, 2024 06:01
@nichamon
Copy link
Collaborator Author

nichamon commented Dec 3, 2024

This change is based on code inspection rather than an observed issue. It standardizes the error response handling in these handlers by using ldmsd_send_req_response() for consistent message length calculation.

@tom95858
Copy link
Collaborator

tom95858 commented Dec 3, 2024

@nichamon does anyone still use ldmsd_send_error_reply?

@nichamon
Copy link
Collaborator Author

nichamon commented Dec 3, 2024

@nichamon does anyone still use ldmsd_send_error_reply?

Yes, ldmsd_process_config_request() calls ldmsd_send_error_reply() to send an error when an error occurs while preparing the request context ldmsd_req_ctxt reqc.

@tom95858
Copy link
Collaborator

tom95858 commented Dec 9, 2024

@nichamon, I'm a little bit concerned that this code is essentially untested unless we force the error path. Have we tried to do that?

Modify updtr_task, prdcr_hint, and set_route handlers to use
ldmsd_send_req_response() for sending error messages back to requesters.
This function automatically handles message length calculation, removing
the need for manual length calculations in these handlers.
@nichamon nichamon force-pushed the consolidate-error-response-handlers branch from 4fdfd7c to 842141b Compare December 10, 2024 02:44
@nichamon
Copy link
Collaborator Author

@nichamon, I'm a little bit concerned that this code is essentially untested unless we force the error path. Have we tried to do that?

@tom95858 Yes, I tested by instrumenting the code to and force it to go through the error paths. While I tested the change in the set_route path, I found bugs in the python code that handles the set_route command. The fix is in PR #1552.

@tom95858 tom95858 merged commit 2fd4d5d into ovis-hpc:b4.4 Dec 11, 2024
14 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