danielealbano / cachegrand

cachegrand - a modern data ingestion, processing and serving platform built for today's hardware
BSD 3-Clause "New" or "Revised" License
975 stars 34 forks source link

Add support for the PING command over the inline protocol #412

Closed danielealbano closed 1 year ago

danielealbano commented 1 year ago

This PR adds, as a quick workaround to fully enable the redis-benchmark cli tool support, the ability to handle the PING command over the inline protocol.

The implementation is fairly simple and works only if the PING command, followed by the new line, fits, in its entirety, the buffer otherwise is reported as error and the connection is closed. As the only reason of this implementation is to support redis-benchmark and it never sends commands byte by byte, we can always expect the command to be in the buffer.

The PR also contains some minor valgrind and comment fixes.

codecov[bot] commented 1 year ago

Codecov Report

Patch coverage: 4.76% and project coverage change: -0.26 :warning:

Comparison is base (a2d7509) 76.74% compared to head (89469fd) 76.48%.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #412 +/- ## ========================================== - Coverage 76.74% 76.48% -0.26% ========================================== Files 198 198 Lines 13538 13580 +42 ========================================== - Hits 10389 10386 -3 - Misses 3149 3194 +45 ``` | Flag | Coverage Δ | | |---|---|---| | unittests | `76.48% <4.76%> (-0.26%)` | :arrow_down: | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Daniele+Salvatore+Albano#carryforward-flags-in-the-pull-request-comment) to find out more. | [Impacted Files](https://app.codecov.io/gh/danielealbano/cachegrand/pull/412?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Daniele+Salvatore+Albano) | Coverage Δ | | |---|---|---| | [src/protocol/redis/protocol\_redis\_reader.c](https://app.codecov.io/gh/danielealbano/cachegrand/pull/412?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Daniele+Salvatore+Albano#diff-c3JjL3Byb3RvY29sL3JlZGlzL3Byb3RvY29sX3JlZGlzX3JlYWRlci5j) | `70.78% <2.86%> (-20.82%)` | :arrow_down: | | [...module/redis/snapshot/module\_redis\_snapshot\_load.c](https://app.codecov.io/gh/danielealbano/cachegrand/pull/412?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Daniele+Salvatore+Albano#diff-c3JjL21vZHVsZS9yZWRpcy9zbmFwc2hvdC9tb2R1bGVfcmVkaXNfc25hcHNob3RfbG9hZC5j) | `32.64% <14.29%> (-0.55%)` | :arrow_down: | ... and [2 files with indirect coverage changes](https://app.codecov.io/gh/danielealbano/cachegrand/pull/412/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Daniele+Salvatore+Albano)

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.