Skip to content

IGNITE-27939 C++ 3.0: Pass MSG_NOSIGNAL to the SSL layer#7674

Open
arcolight wants to merge 4 commits intoapache:mainfrom
gridgain:ignite-27939
Open

IGNITE-27939 C++ 3.0: Pass MSG_NOSIGNAL to the SSL layer#7674
arcolight wants to merge 4 commits intoapache:mainfrom
gridgain:ignite-27939

Conversation

@arcolight
Copy link
Contributor

https://issues.apache.org/jira/browse/IGNITE-27939

Thank you for submitting the pull request.

To streamline the review process of the patch and ensure better code quality
we ask both an author and a reviewer to verify the following:

The Review Checklist

  • Formal criteria: TC status, codestyle, mandatory documentation. Also make sure to complete the following:
    - There is a single JIRA ticket related to the pull request.
    - The web-link to the pull request is attached to the JIRA ticket.
    - The JIRA ticket has the Patch Available state.
    - The description of the JIRA ticket explains WHAT was made, WHY and HOW.
    - The pull request title is treated as the final commit message. The following pattern must be used: IGNITE-XXXX Change summary where XXXX - number of JIRA issue.
  • Design: new code conforms with the design principles of the components it is added to.
  • Patch quality: patch cannot be split into smaller pieces, its size must be reasonable.
  • Code quality: code is clean and readable, necessary developer documentation is added if needed.
  • Tests code quality: test set covers positive/negative scenarios, happy/edge cases. Tests are effective in terms of execution time and resources.

Notes

Copy link

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 refactors the SSL/TLS connection handling in the C++ client to properly pass the MSG_NOSIGNAL flag to the SSL layer on Linux systems. The main goal is to prevent SIGPIPE signals from terminating the application when writing to broken SSL connections. The refactoring introduces a new ssl_connection class that encapsulates the SSL state machine using memory BIOs, and adds platform-specific socket wrapper functions to consistently apply MSG_NOSIGNAL.

Changes:

  • Introduced ssl_connection class to encapsulate SSL/TLS state machine with memory BIOs, separating SSL logic from network I/O
  • Added send() and recv() wrapper functions in detail namespace that apply MSG_NOSIGNAL on Linux (non-macOS) platforms
  • Refactored secure_socket_client and secure_data_filter to use the new ssl_connection abstraction

Reviewed changes

Copilot reviewed 15 out of 15 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
modules/platforms/cpp/ignite/network/ssl/ssl_connection.h New header defining the ssl_connection class for SSL state machine management
modules/platforms/cpp/ignite/network/ssl/ssl_connection.cpp Implementation of ssl_connection with memory BIO handling
modules/platforms/cpp/ignite/network/ssl/secure_socket_client.h Refactored to use ssl_connection and tcp_socket_client composition
modules/platforms/cpp/ignite/network/ssl/secure_socket_client.cpp Simplified SSL connection logic using ssl_connection abstraction
modules/platforms/cpp/ignite/network/ssl/secure_data_filter.h Updated to use ssl_connection instead of raw SSL/BIO pointers
modules/platforms/cpp/ignite/network/ssl/secure_data_filter.cpp Simplified implementation using ssl_connection methods
modules/platforms/cpp/ignite/network/detail/linux/sockets.h Added send, recv, and close wrapper function declarations
modules/platforms/cpp/ignite/network/detail/linux/sockets.cpp Implemented wrappers with MSG_NOSIGNAL support for Linux
modules/platforms/cpp/ignite/network/detail/linux/tcp_socket_client.h Updated to use detail::send and detail::recv wrappers
modules/platforms/cpp/ignite/network/detail/linux/linux_async_client.cpp Updated to use detail::send and detail::recv wrappers
modules/platforms/cpp/ignite/network/detail/win/sockets.h Added send, recv, and close wrapper function declarations for Windows
modules/platforms/cpp/ignite/network/detail/win/sockets.cpp Implemented wrappers and fixed WSA initialization to use std::call_once
modules/platforms/cpp/ignite/network/detail/win/tcp_socket_client.h Updated to use detail::send and detail::recv wrappers
modules/platforms/cpp/tests/fake_server/socket_adapter/posix/client_socket_adapter.h Updated to use detail::send wrapper
modules/platforms/cpp/ignite/network/CMakeLists.txt Added ssl_connection.cpp to build sources

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

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