Allow setting SPDK sock implementation options #2238
The new sock_options matrix entry makes the test step invoke tests/test_sock_options.py, but that file is not included in this PR or present in the checkout. This job will fail because pytest cannot find the requested file. Please commit the socket-options test module alongside this matrix entry.
The SSL example uses sock_impl_options as a nested option name instead of recv_buf_size. Copying this example forwards the configuration key itself to SPDK rather than setting the intended receive-buffer size. Please use recv_buf_size, matching the default below and in _start_spdk.
<!-- ccr-overview-v2 -->
🟡 Changes recommended
The new CI job targets a missing test module and will fail rather than validate socket options.
<details open>
<summary><strong>2 open issues</strong></summary>
</details>
<details>
<summary><strong>What changed in this PR</strong></summary>
Adds configuration-file support for SPDK socket implementation options, addressing #2237 within gateway startup.
Changes:
sock_options CI matrix entry.| File | Description |
| ---- | ----------- |
| control/server.py | Loads and applies socket options during SPDK initialization. |
| ceph-nvmeof.conf | Adds socket-option configuration examples. |
| .github/workflows/build-container.yml | Adds the socket-options test job. |
</details>
<sub>Review effort: Balanced</sub>
forgot to add it, fixed
typo, fixed
An explicit configuration such as {"ssl": {"ssl_tickets_number": 2}} is applied here but immediately overwritten by _set_num_ssl_tickets(0) below, so the gateway silently ignores this socket option. Apply the default ticket count before the configured options so explicit values take precedence.
<!-- ccr-overview-v2 -->
🟡 Changes recommended
Startup overwrites explicitly configured SSL ticket counts with zero.
<details open>
<summary><strong>1 open issue</strong></summary>
</details>
<details>
<summary><strong>2 resolved since last review</strong></summary>
</details>
<sub>Review effort: Balanced</sub>
changed
Startup still calls _set_num_ssl_tickets(0) after applying the configured socket options, discarding any explicit ssl_tickets_number. The newly added assertion in tests/test_sock_options.py:55 expects 5, but this sequence leaves it at 0. Apply the zero-ticket default before the configured options so explicit values take precedence.
<!-- ccr-overview-v2 -->
🟡 Changes recommended
Startup still overwrites the configured SSL ticket count, contradicting the new test’s expected value.
<details open>
<summary><strong>1 open issue</strong></summary>
</details>
<details>
<summary><strong>1 resolved since last review</strong></summary>
</details>
<sub>Review effort: Balanced</sub>
changed
<!-- ccr-overview-v2 -->
🟢 Approval recommended
No blocking issues remain in the reviewed changes; integration coverage is included, but container-dependent tests were not run here.
No open issues 🎉
<details>
<summary><strong>1 resolved since last review</strong></summary>
</details>
<sub>Review effort: Balanced</sub>
Approved these changes.
Invalid sock_impl_options can abort startup: null raises TypeError in args.update(), and a nonempty SSL list raises AttributeError at ssl_arg.get(). Malformed JSON instead returns early, allowing startup to continue without applying the existing zero-ticket SSL default. Validate that the outer value and each implementation's options are objects, then log invalid input and continue with empty options so the SSL default is still applied.
<!-- ccr-overview-v2 -->
🟡 Changes recommended
Invalid socket-option configuration can abort startup or bypass the existing zero-ticket SSL initialization.
<details open>
<summary><strong>1 open issue</strong></summary>
</details>
<sub>Review effort: Balanced</sub>
changed
[P1] Both channel variables are assigned but never read, so Flake8 reports F841. The build job runs make verify, which includes tests/*.py, before building the containers; these assignments therefore block the build and dependent test jobs. Remove the unused channel setup, along with the now-unneeded grpc import and addr lookup.
[P2] Returning here leaves both gateways running because the fixture never invokes GatewayServer.__exit__ to release their processes, listeners, and OMAP resources. Subsequent modules in the same pytest process can encounter occupied ports and sockets. Wrap both gateways in context managers and yield their RPC objects, as in tests/test_multi_gateway.py:47–67, so cleanup also runs when an assertion or startup fails.
<!-- ccr-overview-v2 -->
🟡 Changes recommended
The new test fixture introduces CI-blocking unused variables and leaves gateway resources running without teardown.
<details open>
<summary><strong>2 open issues</strong></summary>
</details>
<details>
<summary><strong>1 resolved since last review</strong></summary>
</details>
<sub>Review effort: Balanced</sub>
changed
changed
The docstring misspells “implementation” as “implmentation”.
<!-- ccr-overview-v2 -->
🟢 Approval recommended
No blocking issues remain; the only retained feedback is a minor docstring typo.
<details open>
<summary><strong>1 open issue</strong></summary>
</details>
<details>
<summary><strong>2 resolved since last review</strong></summary>
</details>
<sub>Review effort: Balanced</sub>
changed
[P2] A structurally valid configuration with an unsupported SSL option can fail at sock_impl_set_options, also preventing the bundled ssl_tickets_number=0 from being applied. Startup then continues without the previous zero-ticket initialization. Set the baseline ticket count separately before applying configured options so rejected options cannot bypass it and valid explicit ticket counts still take precedence.
<!-- ccr-overview-v2 -->
🟡 Changes recommended
Rejected SSL options can prevent the zero-ticket baseline from being applied while startup continues.
<details open>
<summary><strong>1 open issue</strong></summary>
</details>
<details>
<summary><strong>1 resolved since last review</strong></summary>
</details>
<sub>Review effort: Balanced</sub>
changed
Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.
An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.
leonidc
gbregman
Fixes: #2237