-
Notifications
You must be signed in to change notification settings - Fork 990
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: update helio and improve our stack overflow resiliency (#4349)
1. Run CI/Regression tests with HELIO_STACK_CHECK=4096. This will crash if a fiber stack usage goes below this limit. 2. Increase shard queue stack size to 64KB 3. Increase fiber stack size to 40KB on Debug builds. 4. Updated helio has some changes around the TLS socket code. In addition we add a helper script to generate self-signed certificates helpful for local development work. Signed-off-by: Roman Gershman <[email protected]>
- Loading branch information
Showing
8 changed files
with
108 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Submodule helio
updated
21 files
+690 −426 | base/function2.hpp | |
+1 −1 | base/mpmc_bounded_queue.h | |
+2 −21 | cmake/third_party.cmake | |
+22 −4 | examples/gcs_demo.cc | |
+20 −9 | util/cloud/azure/azure.cc | |
+100 −70 | util/cloud/azure/storage.cc | |
+9 −4 | util/cloud/azure/storage.h | |
+0 −10 | util/cloud/gcp/gcp_utils.h | |
+4 −49 | util/cloud/gcp/gcs_file.cc | |
+43 −1 | util/cloud/utils.cc | |
+44 −3 | util/cloud/utils.h | |
+6 −3 | util/fibers/CMakeLists.txt | |
+26 −11 | util/fibers/detail/fiber_interface.cc | |
+9 −17 | util/fibers/detail/fiber_interface.h | |
+8 −4 | util/fibers/dns_resolve.cc | |
+3 −0 | util/fibers/fibers_test.cc | |
+50 −43 | util/tls/tls_engine.cc | |
+14 −5 | util/tls/tls_engine.h | |
+62 −55 | util/tls/tls_engine_test.cc | |
+95 −108 | util/tls/tls_socket.cc | |
+10 −1 | util/tls/tls_socket.h |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
#!/bin/bash | ||
set -e | ||
|
||
SCRIPT_DIR=$(dirname "$0") | ||
ROOT_DIR=$(readlink -f "$SCRIPT_DIR/../..") | ||
GEN_DIR=$ROOT_DIR/genfiles/tls | ||
|
||
|
||
# genfiles/tls/ca.{crt,key} Self signed CA certificate. | ||
# genfiles/tls/dragonfly.{crt,key} A certificate with no key usage/policy restrictions. | ||
# genfiles/tls/client.{crt,key} A certificate restricted for SSL client usage. | ||
# genfiles/tls/server.{crt,key} A certificate restricted for SSL server usage. | ||
|
||
: ' | ||
To run dragonfly use: | ||
dragonfly --tls --tls_key_file ../genfiles/tls/server.key --tls_cert_file ../genfiles/tls/server.crt -requirepass pass | ||
Or with CA (does not require password): | ||
dragonfly --tls --tls_key_file ../genfiles/tls/server.key --tls_cert_file ../genfiles/tls/server.crt \ | ||
--tls_ca_cert_file ../genfiles/tls/ca.crt | ||
To connect with client (without ca): | ||
openssl s_client -state -crlf -connect 127.0.0.1:6379 | ||
With CA: | ||
openssl s_client -state -crlf -CAfile ../genfiles/tls/ca.crt -cert ../genfiles/tls/client.crt -key ../genfiles/tls/client.key -connect 127.0.0.1:6379 | ||
Similarly, to connect with redis-cli (no CA): | ||
redis-cli --tls --insecure -a pass | ||
With CA: | ||
redis-cli --tls --cacert ../genfiles/tls/ca.crt --cert ../genfiles/tls/client.crt --key ../genfiles/tls/client.key | ||
memtier (without CA): | ||
memtier_benchmark --tls --key ../genfiles/tls/client.key --cert ../genfiles/tls/client.crt -a pass | ||
memtier (with CA): | ||
memtier_benchmark --tls --key ../genfiles/tls/client.key --cert ../genfiles/tls/client.crt --cacert ../genfiles/tls/ca.crt | ||
' | ||
|
||
generate_cert() { | ||
local name=$1 | ||
local cn="$2" | ||
local opts="$3" | ||
|
||
local keyfile=$GEN_DIR/${name}.key | ||
local certfile=$GEN_DIR/${name}.crt | ||
|
||
[ -f $keyfile ] || openssl genpkey -algorithm ED25519 -out $keyfile | ||
openssl req -new -sha256 \ | ||
-subj "/O=Dragonfly Test/CN=$cn" \ | ||
-key $keyfile | \ | ||
openssl x509 \ | ||
-req -sha256 \ | ||
-CA $GEN_DIR/ca.crt \ | ||
-CAkey $GEN_DIR/ca.key \ | ||
-CAserial $GEN_DIR/ca.txt \ | ||
-CAcreateserial \ | ||
-days 365 \ | ||
$opts \ | ||
-out $certfile | ||
} | ||
|
||
mkdir -p $GEN_DIR | ||
[ -f $GEN_DIR/ca.key ] || openssl genpkey -algorithm ED25519 -out $GEN_DIR/ca.key | ||
|
||
# -x509: self-signed certificate, -nodes: no password | ||
openssl req \ | ||
-x509 -new -nodes -sha256 \ | ||
-key $GEN_DIR/ca.key \ | ||
-days 3650 \ | ||
-subj '/O=Dragonfly Test/CN=Certificate Authority' \ | ||
-out $GEN_DIR/ca.crt | ||
|
||
cat > $GEN_DIR/openssl.cnf <<_END_ | ||
[ server_cert ] | ||
keyUsage = digitalSignature, keyEncipherment | ||
nsCertType = server | ||
[ client_cert ] | ||
keyUsage = digitalSignature, keyEncipherment | ||
nsCertType = client | ||
_END_ | ||
|
||
generate_cert server "Server-only" "-extfile $GEN_DIR/openssl.cnf -extensions server_cert" | ||
generate_cert client "Client-only" "-extfile $GEN_DIR/openssl.cnf -extensions client_cert" | ||
generate_cert dragonfly "Generic-cert" |