-
Notifications
You must be signed in to change notification settings - Fork 955
Don't call SSL_write() with num=0 #2490
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
Conversation
Signed-off-by: yzc-yzc <[email protected]>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## unstable #2490 +/- ##
============================================
- Coverage 72.05% 72.00% -0.05%
============================================
Files 126 126
Lines 70446 70448 +2
============================================
- Hits 50760 50727 -33
- Misses 19686 19721 +35
🚀 New features to boost your workflow:
|
Signed-off-by: yzc-yzc <[email protected]>
|
Great to see progress on this! So there can exist reply blocks (list nodes) with zero bytes? How/why do we create them? |
e.g. The last node of the replication buffer list has |
zuiderkwast
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, makes sense!
|
Looking at git blame, it seems that this bug was introduced in which was released in 8.1, so it means we need to backport this fix to 8.1 only. 8.0 and before are not affected AFAICT. |
https://github.com/valkey-io/valkey/blob/aefed3d363d1c7d7cb391d3f605484c78c9a88f2/src/networking.c#L2279-L2293 From above code, we can see that `c->repl_data->ref_block_pos` could be equal to `o->used`. When `o->used == o->size`, we may call SSL_write() with num=0 which does not comply with the openSSL specification. (ref: https://docs.openssl.org/master/man3/SSL_write/#warnings) What's worse is that it's still the case after the reconnection. See https://github.com/valkey-io/valkey/blob/aefed3d363d1c7d7cb391d3f605484c78c9a88f2/src/replication.c#L756-L769. So in this case the replica will keep reconnecting again and again until it doesn't meet the requirements for partial synchronization. Resolves valkey-io#2119 --------- Signed-off-by: yzc-yzc <[email protected]>
https://github.com/valkey-io/valkey/blob/aefed3d363d1c7d7cb391d3f605484c78c9a88f2/src/networking.c#L2279-L2293 From above code, we can see that `c->repl_data->ref_block_pos` could be equal to `o->used`. When `o->used == o->size`, we may call SSL_write() with num=0 which does not comply with the openSSL specification. (ref: https://docs.openssl.org/master/man3/SSL_write/#warnings) What's worse is that it's still the case after the reconnection. See https://github.com/valkey-io/valkey/blob/aefed3d363d1c7d7cb391d3f605484c78c9a88f2/src/replication.c#L756-L769. So in this case the replica will keep reconnecting again and again until it doesn't meet the requirements for partial synchronization. Resolves valkey-io#2119 --------- Signed-off-by: yzc-yzc <[email protected]>
https://github.com/valkey-io/valkey/blob/aefed3d363d1c7d7cb391d3f605484c78c9a88f2/src/networking.c#L2279-L2293 From above code, we can see that `c->repl_data->ref_block_pos` could be equal to `o->used`. When `o->used == o->size`, we may call SSL_write() with num=0 which does not comply with the openSSL specification. (ref: https://docs.openssl.org/master/man3/SSL_write/#warnings) What's worse is that it's still the case after the reconnection. See https://github.com/valkey-io/valkey/blob/aefed3d363d1c7d7cb391d3f605484c78c9a88f2/src/replication.c#L756-L769. So in this case the replica will keep reconnecting again and again until it doesn't meet the requirements for partial synchronization. Resolves valkey-io#2119 --------- Signed-off-by: yzc-yzc <[email protected]>
https://github.com/valkey-io/valkey/blob/aefed3d363d1c7d7cb391d3f605484c78c9a88f2/src/networking.c#L2279-L2293 From above code, we can see that `c->repl_data->ref_block_pos` could be equal to `o->used`. When `o->used == o->size`, we may call SSL_write() with num=0 which does not comply with the openSSL specification. (ref: https://docs.openssl.org/master/man3/SSL_write/#warnings) What's worse is that it's still the case after the reconnection. See https://github.com/valkey-io/valkey/blob/aefed3d363d1c7d7cb391d3f605484c78c9a88f2/src/replication.c#L756-L769. So in this case the replica will keep reconnecting again and again until it doesn't meet the requirements for partial synchronization. Resolves #2119 --------- Signed-off-by: yzc-yzc <[email protected]>
https://github.com/valkey-io/valkey/blob/aefed3d363d1c7d7cb391d3f605484c78c9a88f2/src/networking.c#L2279-L2293 From above code, we can see that `c->repl_data->ref_block_pos` could be equal to `o->used`. When `o->used == o->size`, we may call SSL_write() with num=0 which does not comply with the openSSL specification. (ref: https://docs.openssl.org/master/man3/SSL_write/#warnings) What's worse is that it's still the case after the reconnection. See https://github.com/valkey-io/valkey/blob/aefed3d363d1c7d7cb391d3f605484c78c9a88f2/src/replication.c#L756-L769. So in this case the replica will keep reconnecting again and again until it doesn't meet the requirements for partial synchronization. Resolves valkey-io#2119 --------- Signed-off-by: yzc-yzc <[email protected]>
https://github.com/valkey-io/valkey/blob/aefed3d363d1c7d7cb391d3f605484c78c9a88f2/src/networking.c#L2279-L2293 From above code, we can see that `c->repl_data->ref_block_pos` could be equal to `o->used`. When `o->used == o->size`, we may call SSL_write() with num=0 which does not comply with the openSSL specification. (ref: https://docs.openssl.org/master/man3/SSL_write/#warnings) What's worse is that it's still the case after the reconnection. See https://github.com/valkey-io/valkey/blob/aefed3d363d1c7d7cb391d3f605484c78c9a88f2/src/replication.c#L756-L769. So in this case the replica will keep reconnecting again and again until it doesn't meet the requirements for partial synchronization. Resolves valkey-io#2119 --------- Signed-off-by: yzc-yzc <[email protected]>
https://github.com/valkey-io/valkey/blob/aefed3d363d1c7d7cb391d3f605484c78c9a88f2/src/networking.c#L2279-L2293 From above code, we can see that `c->repl_data->ref_block_pos` could be equal to `o->used`. When `o->used == o->size`, we may call SSL_write() with num=0 which does not comply with the openSSL specification. (ref: https://docs.openssl.org/master/man3/SSL_write/#warnings) What's worse is that it's still the case after the reconnection. See https://github.com/valkey-io/valkey/blob/aefed3d363d1c7d7cb391d3f605484c78c9a88f2/src/replication.c#L756-L769. So in this case the replica will keep reconnecting again and again until it doesn't meet the requirements for partial synchronization. Resolves #2119 --------- Signed-off-by: yzc-yzc <[email protected]>
https://github.com/valkey-io/valkey/blob/aefed3d363d1c7d7cb391d3f605484c78c9a88f2/src/networking.c#L2279-L2293 From above code, we can see that `c->repl_data->ref_block_pos` could be equal to `o->used`. When `o->used == o->size`, we may call SSL_write() with num=0 which does not comply with the openSSL specification. (ref: https://docs.openssl.org/master/man3/SSL_write/#warnings) What's worse is that it's still the case after the reconnection. See https://github.com/valkey-io/valkey/blob/aefed3d363d1c7d7cb391d3f605484c78c9a88f2/src/replication.c#L756-L769. So in this case the replica will keep reconnecting again and again until it doesn't meet the requirements for partial synchronization. Resolves valkey-io#2119 --------- Signed-off-by: yzc-yzc <[email protected]> Signed-off-by: Harkrishn Patro <[email protected]>
valkey/src/networking.c
Lines 2279 to 2293 in aefed3d
From above code, we can see that
c->repl_data->ref_block_poscould be equal too->used.When
o->used == o->size, we may call SSL_write() with num=0 which does not comply with the openSSL specification.(ref: https://docs.openssl.org/master/man3/SSL_write/#warnings)
What's worse is that it's still the case after the reconnection. See
valkey/src/replication.c
Lines 756 to 769 in aefed3d
Resolves #2119