diff --git a/.github/workflows/notify-slack.yaml b/.github/workflows/notify-slack.yaml index f6d7d403..8ea26ffc 100644 --- a/.github/workflows/notify-slack.yaml +++ b/.github/workflows/notify-slack.yaml @@ -48,7 +48,7 @@ jobs: } - name: Send issue comments notification to Slack - if: github.event_name == 'issue_comment' && !github.event.issue.pull_request + if: github.event_name == 'issue_comment' && !github.event.issue.pull_request uses: slackapi/slack-github-action@v2.1.1 with: webhook: ${{ secrets.SLACK_WEBHOOK_URL }} diff --git a/CHANGELOG-3.x.md b/CHANGELOG-3.x.md index 7b53b00b..a540225d 100644 --- a/CHANGELOG-3.x.md +++ b/CHANGELOG-3.x.md @@ -1,3 +1,7 @@ +# v3.1.1 +- Update proxy connection scaling logic +- Fix IndexError in get_system_release_version on SUSE SLES 16 + # v3.1.0 - Enable readahead caching in proxy for bypassed reads - Clean up warnings in proxy diff --git a/INSTALL.md b/INSTALL.md index 75f7ed22..49d29a6b 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -12,9 +12,9 @@ This guide provides detailed instructions for building `efs-utils` from source o ## Build Prerequisites -Building efs-utils v2.0+ requires the following dependencies: +Building efs-utils v3.0+ requires the following dependencies: -* `rust` 1.70+ +* `rust` 1.91.1+ * `cargo` * `go` 1.17.13+ * `perl` @@ -166,6 +166,16 @@ curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh . "$HOME/.cargo/env" ``` +### `make rpm` fails due to "rustc X.X.X is not supported by the following packages" ### + +Your system Rust is older than 1.91.1. Remove the system Rust, install via rustup, and build with `make rpm-without-system-rust`: +```bash +sudo yum remove -y cargo rust +curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh +. "$HOME/.cargo/env" +make rpm-without-system-rust +``` + ### You installed a new version of rust with the above command, but your system is still using the rust installed by the package manager ### When installing rust with the rustup script above, the script will fail if it detects a rust already exists on the system. @@ -198,8 +208,8 @@ If rust dependencies was installed using rustup and the package manager does not ``` error: Failed build dependencies: - cargo is needed by amazon-efs-utils-2.1.0-1.el7_9.x86_64 - rust is needed by amazon-efs-utils-2.1.0-1.el7_9.x86_64 + cargo is needed by amazon-efs-utils-3.1.0-1.el8.x86_64 + rust is needed by amazon-efs-utils-3.1.0-1.el8.x86_64 ``` In this case, the 'make rpm' command in the installation script above should be replaced by 'make rpm-without-system-rust' to remove the rpmbuild dependency check. diff --git a/README.md b/README.md index a37f8d9a..b44823fc 100644 --- a/README.md +++ b/README.md @@ -82,7 +82,7 @@ You can use AWS Systems Manager Distributor to automatically install or update ` ### Other Linux Distributions -Building from source requires Rust 1.70+, Cargo, Go 1.17.13+, CMake 3.0+, GCC/G++, and Perl. See [INSTALL.md](INSTALL.md) for detailed build instructions for your distribution. +Building from source requires Rust 1.91.1+, Cargo, Go 1.17.13+, CMake 3.0+, GCC/G++, and Perl. See [INSTALL.md](INSTALL.md) for detailed build instructions for your distribution. ### For macOS Tahoe, Sequoia, Sonoma, and Ventura distributions @@ -283,7 +283,7 @@ Make sure to re run the failed mount again after running the prior commands befo # Upgrading Efs-utils Versions ### Upgrading efs-utils from v1 to v2 -Efs-utils v2.0.0 replaces stunnel, which provides TLS encryptions for mounts, with efs-proxy an AWS built component built. Efs-proxy is the primary the foundation for all new feature support for EFS. To receive the performance benefits of efs-proxy, you need to re-mount any existing mounts. Note: Efs-proxy is not compatible with OCSP or Mac clients. In these cases, efs-utils will automatically revert back to using stunnel. If you build efs-utils v2.0.0 from source Rust and Cargo are required for versions 1.70+. +Efs-utils v2.0.0 replaces stunnel, which provides TLS encryptions for mounts, with efs-proxy an AWS built component built. Efs-proxy is the primary the foundation for all new feature support for EFS. To receive the performance benefits of efs-proxy, you need to re-mount any existing mounts. Note: Efs-proxy is not compatible with OCSP or Mac clients. In these cases, efs-utils will automatically revert back to using stunnel. ### Upgrading from efs-utils v2 to v3 Efs-utils v3.0.0 adds support for S3 Files. There are no breaking changes upgrading from v2 to v3.0.0. diff --git a/amazon-efs-utils.spec b/amazon-efs-utils.spec index 2f108f42..41559a5a 100644 --- a/amazon-efs-utils.spec +++ b/amazon-efs-utils.spec @@ -41,7 +41,7 @@ %{?!include_vendor_tarball:%define include_vendor_tarball true} Name : amazon-efs-utils -Version : 3.1.0 +Version : 3.1.1 Release : 1%{platform} Summary : This package provides utilities for simplifying the use of EFS file systems @@ -215,6 +215,10 @@ fi %clean %changelog +* Mon Apr 27 2026 Zachary Maguire - 3.1.1 +- Update proxy connection scaling logic +- Fix IndexError in get_system_release_version on SUSE SLES 16 + * Fri Apr 17 2026 Samuel Hale - 3.1.0 - Enable readahead caching in proxy for bypassed reads - Clean up warnings in proxy diff --git a/build-deb.sh b/build-deb.sh index 2dc21188..92ebeb78 100755 --- a/build-deb.sh +++ b/build-deb.sh @@ -11,7 +11,7 @@ set -ex BASE_DIR=$(pwd) BUILD_ROOT=${BASE_DIR}/build/debbuild -VERSION=3.1.0 +VERSION=3.1.1 RELEASE=1 ARCH=$(dpkg --print-architecture) DEB_SYSTEM_RELEASE_PATH=/etc/os-release diff --git a/config.ini b/config.ini index f7a7007d..63831eda 100644 --- a/config.ini +++ b/config.ini @@ -7,5 +7,5 @@ # [global] -version=3.1.0 +version=3.1.1 release=1 diff --git a/src/efs_utils_common/constants.py b/src/efs_utils_common/constants.py index f91288c8..f0936778 100644 --- a/src/efs_utils_common/constants.py +++ b/src/efs_utils_common/constants.py @@ -11,7 +11,7 @@ import pwd import re -VERSION = "3.1.0" +VERSION = "3.1.1" AMAZON_LINUX_2_RELEASE_ID = "Amazon Linux release 2 (Karoo)" AMAZON_LINUX_2_PRETTY_NAME = "Amazon Linux 2" diff --git a/src/efs_utils_common/platform_utils.py b/src/efs_utils_common/platform_utils.py index 36b309c2..ff8c3716 100644 --- a/src/efs_utils_common/platform_utils.py +++ b/src/efs_utils_common/platform_utils.py @@ -46,8 +46,10 @@ def get_system_release_version(): try: with open(OS_RELEASE_PATH) as f: for line in f: - if "PRETTY_NAME" in line: - return line.split("=")[1].strip() + line = line.strip() + if line.startswith("PRETTY_NAME="): + value = line.split("=", 1)[1].strip() + return value.strip('"').strip("'") except IOError: logging.debug("Unable to read %s", OS_RELEASE_PATH) diff --git a/src/proxy/Cargo.lock b/src/proxy/Cargo.lock index b8bab005..eb33ec3b 100644 --- a/src/proxy/Cargo.lock +++ b/src/proxy/Cargo.lock @@ -122,9 +122,9 @@ checksum = "c08606f8c3cbf4ce6ec8e28fb0014a2c086708fe954eaa885384a6165172e7e8" [[package]] name = "aws-config" -version = "1.8.15" +version = "1.8.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "11493b0bad143270fb8ad284a096dd529ba91924c5409adeac856cc1bf047dbc" +checksum = "50f156acdd2cf55f5aa53ee416c4ac851cf1222694506c0b1f78c85695e9ca9d" dependencies = [ "aws-credential-types", "aws-runtime", @@ -202,9 +202,9 @@ dependencies = [ [[package]] name = "aws-runtime" -version = "1.7.2" +version = "1.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5fc0651c57e384202e47153c1260b84a9936e19803d747615edf199dc3b98d17" +checksum = "5dcd93c82209ac7413532388067dce79be5a8780c1786e5fae3df22e4dee2864" dependencies = [ "aws-credential-types", "aws-sigv4", @@ -230,9 +230,9 @@ dependencies = [ [[package]] name = "aws-sdk-cloudwatch" -version = "1.109.1" +version = "1.110.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6447208b6439be1c61a6e9ae0cb93bf0eccbbcc34b093b94830fde6c93943108" +checksum = "cd42d00863c342bcfedfc4f38845103f5b06b01b3b5024c02fa5aeafbb1195a5" dependencies = [ "aws-credential-types", "aws-runtime", @@ -258,9 +258,9 @@ dependencies = [ [[package]] name = "aws-sdk-cloudwatchlogs" -version = "1.126.0" +version = "1.129.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32b83559fad7aa43fe5dba042145ecf8ad53075a819dd1f245d6e1e654d46344" +checksum = "ba73166148f1036fb3f512e4f05a025ab3338469cc97fa87684978526d6d728a" dependencies = [ "aws-credential-types", "aws-runtime", @@ -283,9 +283,9 @@ dependencies = [ [[package]] name = "aws-sdk-s3" -version = "1.129.0" +version = "1.131.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d4e8410fadbc0ee453145dd77a4958227b18b05bf67c2795d0a8b8596c9aa0f" +checksum = "fe1b8c5282bf859170836045296b3cd710b7573aceb909498366bb508a41058e" dependencies = [ "aws-credential-types", "aws-runtime", @@ -304,23 +304,23 @@ dependencies = [ "bytes", "fastrand", "hex", - "hmac", + "hmac 0.13.0", "http 0.2.12", "http 1.4.0", "http-body 1.0.1", "lru", "percent-encoding", "regex-lite", - "sha2 0.10.9", + "sha2 0.11.0", "tracing", "url", ] [[package]] name = "aws-sdk-sso" -version = "1.97.0" +version = "1.98.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9aadc669e184501caaa6beafb28c6267fc1baef0810fb58f9b205485ca3f2567" +checksum = "d69c77aafa20460c68b6b3213c84f6423b6e76dbf89accd3e1789a686ffd9489" dependencies = [ "aws-credential-types", "aws-runtime", @@ -342,9 +342,9 @@ dependencies = [ [[package]] name = "aws-sdk-ssooidc" -version = "1.99.0" +version = "1.100.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1342a7db8f358d3de0aed2007a0b54e875458e39848d54cc1d46700b2bfcb0a8" +checksum = "1c7e7b09346d5ca22a2a08267555843a6a0127fb20d8964cb6ecfb8fdb190225" dependencies = [ "aws-credential-types", "aws-runtime", @@ -366,9 +366,9 @@ dependencies = [ [[package]] name = "aws-sdk-sts" -version = "1.102.0" +version = "1.103.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fc35b7a14cabdad13795fbbbd26d5ddec0882c01492ceedf2af575aad5f37dd" +checksum = "c2249b81a2e73a8027c41c378463a81ec39b8510f184f2caab87de912af0f49b" dependencies = [ "aws-credential-types", "aws-runtime", @@ -391,9 +391,9 @@ dependencies = [ [[package]] name = "aws-sigv4" -version = "1.4.2" +version = "1.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0b660013a6683ab23797778e21f1f854744fdf05f68204b4cca4c8c04b5d1f4" +checksum = "68dc0b907359b120170613b5c09ccc61304eac3998ff6274b97d93ee6490115a" dependencies = [ "aws-credential-types", "aws-smithy-eventstream", @@ -404,13 +404,13 @@ dependencies = [ "crypto-bigint 0.5.5", "form_urlencoded", "hex", - "hmac", + "hmac 0.13.0", "http 0.2.12", "http 1.4.0", "p256", "percent-encoding", "ring", - "sha2 0.10.9", + "sha2 0.11.0", "subtle", "time", "tracing", @@ -535,7 +535,7 @@ dependencies = [ "indexmap", "pin-project-lite", "rustls 0.21.12", - "rustls 0.23.38", + "rustls 0.23.40", "rustls-native-certs", "rustls-pki-types", "serde", @@ -697,9 +697,9 @@ dependencies = [ [[package]] name = "aws-types" -version = "1.3.14" +version = "1.3.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "47c8323699dd9b3c8d5b3c13051ae9cdef58fd179957c882f8374dd8725962d9" +checksum = "2f4bbcaa9304ea40902d3d5f42a0428d1bd895a2b0f6999436fb279ffddc58ac" dependencies = [ "aws-credential-types", "aws-smithy-async", @@ -866,9 +866,9 @@ dependencies = [ [[package]] name = "cc" -version = "1.2.60" +version = "1.2.61" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43c5703da9466b66a946814e1adf53ea2c90f10063b86290cc9eb67ce3478a20" +checksum = "d16d90359e986641506914ba71350897565610e87ce0ad9e6f28569db3dd5c6d" dependencies = [ "find-msvc-tools", "jobserver", @@ -1014,6 +1014,12 @@ dependencies = [ "cc", ] +[[package]] +name = "cmov" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f88a43d011fc4a6876cb7344703e297c71dda42494fee094d5f7c76bf13f746" + [[package]] name = "const-oid" version = "0.9.6" @@ -1071,9 +1077,9 @@ dependencies = [ [[package]] name = "crc-catalog" -version = "2.4.0" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "19d374276b40fb8bbdee95aef7c7fa6b5316ec764510eb64b8dd0e2ed0d7e7f5" +checksum = "217698eaf96b4a3f0bc4f3662aaa55bdf913cd54d7204591faa790070c6d0853" [[package]] name = "crc-fast" @@ -1177,6 +1183,15 @@ dependencies = [ "hybrid-array", ] +[[package]] +name = "ctutils" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7d5515a3834141de9eafb9717ad39eea8247b5674e6066c404e8c4b365d2a29e" +dependencies = [ + "cmov", +] + [[package]] name = "dashmap" version = "6.1.0" @@ -1193,9 +1208,9 @@ dependencies = [ [[package]] name = "data-encoding" -version = "2.10.0" +version = "2.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d7a1e2f27636f116493b8b860f5546edb47c8d8f8ea73e1d2a20be88e28d1fea" +checksum = "a4ae5f15dda3c708c0ade84bfee31ccab44a3da4f88015ed22f63732abe300c8" [[package]] name = "der" @@ -1276,6 +1291,7 @@ dependencies = [ "block-buffer 0.12.0", "const-oid 0.10.2", "crypto-common 0.2.1", + "ctutils", ] [[package]] @@ -1321,7 +1337,7 @@ dependencies = [ [[package]] name = "efs-proxy" -version = "3.1.0" +version = "3.1.1" dependencies = [ "anyhow", "async-trait", @@ -1806,6 +1822,15 @@ dependencies = [ "digest 0.10.7", ] +[[package]] +name = "hmac" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6303bc9732ae41b04cb554b844a762b4115a61bfaa81e3e83050991eeb56863f" +dependencies = [ + "digest 0.11.2", +] + [[package]] name = "http" version = "0.2.12" @@ -1881,9 +1906,9 @@ checksum = "135b12329e5e3ce057a9f972339ea52bc954fe1e9358ef27f95e89716fbc5424" [[package]] name = "hybrid-array" -version = "0.4.10" +version = "0.4.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3944cf8cf766b40e2a1a333ee5e9b563f854d5fa49d6a8ca2764e97c6eddb214" +checksum = "08d46837a0ed51fe95bd3b05de33cd64a1ee88fc797477ca48446872504507c5" dependencies = [ "typenum", ] @@ -1957,7 +1982,7 @@ dependencies = [ "http 1.4.0", "hyper 1.9.0", "hyper-util", - "rustls 0.23.38", + "rustls 0.23.40", "rustls-native-certs", "tokio", "tokio-rustls 0.26.4", @@ -2112,9 +2137,9 @@ dependencies = [ [[package]] name = "idna_adapter" -version = "1.2.1" +version = "1.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3acae9609540aa318d1bc588455225fb2085b9ed0c4f6bd0d9d5bcd86f1a0344" +checksum = "cb68373c0d6620ef8105e855e7745e18b0d00d3bdb07fb532e434244cdb9a714" dependencies = [ "icu_normalizer", "icu_properties", @@ -2185,10 +2210,12 @@ dependencies = [ [[package]] name = "js-sys" -version = "0.3.95" +version = "0.3.97" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2964e92d1d9dc3364cae4d718d93f227e3abb088e747d92e0395bfdedf1c12ca" +checksum = "a1840c94c045fbcf8ba2812c95db44499f7c64910a912551aaaa541decebcacf" dependencies = [ + "cfg-if", + "futures-util", "once_cell", "wasm-bindgen", ] @@ -2213,9 +2240,9 @@ checksum = "09edd9e8b54e49e587e4f6295a7d29c3ea94d469cb40ab8ca70b288248a81db2" [[package]] name = "libc" -version = "0.2.185" +version = "0.2.186" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "52ff2c0fe9bc6cb6b14a0592c2ff4fa9ceb83eea9db979b0487cd054946a2b8f" +checksum = "68ab91017fe16c622486840e4c83c9a37afeff978bd239b5293d61ece587de66" [[package]] name = "libloading" @@ -2960,7 +2987,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7743f17af12fa0b03b803ba12cd6a8d9483a587e89c69445e3909655c0b9fabb" dependencies = [ "crypto-bigint 0.4.9", - "hmac", + "hmac 0.12.1", "zeroize", ] @@ -3035,14 +3062,14 @@ dependencies = [ [[package]] name = "rustls" -version = "0.23.38" +version = "0.23.40" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "69f9466fb2c14ea04357e91413efb882e2a6d4a406e625449bc0a5d360d53a21" +checksum = "ef86cd5876211988985292b91c96a8f2d298df24e75989a43a3c73f2d4d8168b" dependencies = [ "aws-lc-rs", "once_cell", "rustls-pki-types", - "rustls-webpki 0.103.12", + "rustls-webpki 0.103.13", "subtle", "zeroize", ] @@ -3061,9 +3088,9 @@ dependencies = [ [[package]] name = "rustls-pki-types" -version = "1.14.0" +version = "1.14.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be040f8b0a225e40375822a563fa9524378b9d63112f53e19ffff34df5d33fdd" +checksum = "30a7197ae7eb376e574fe940d068c30fe0462554a3ddbe4eca7838e049c937a9" dependencies = [ "zeroize", ] @@ -3080,9 +3107,9 @@ dependencies = [ [[package]] name = "rustls-webpki" -version = "0.103.12" +version = "0.103.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8279bb85272c9f10811ae6a6c547ff594d6a7f3c6c6b02ee9726d1d0dcfcdd06" +checksum = "61c429a8649f110dddef65e2a5ad240f747e85f7758a6bccc7e5777bd33f756e" dependencies = [ "aws-lc-rs", "ring", @@ -3808,7 +3835,7 @@ version = "0.26.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1729aa945f29d91ba541258c8df89027d5792d85a8841fb65e8bf0f4ede4ef61" dependencies = [ - "rustls 0.23.38", + "rustls 0.23.40", "tokio", ] @@ -4094,9 +4121,9 @@ dependencies = [ [[package]] name = "wasm-bindgen" -version = "0.2.118" +version = "0.2.120" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0bf938a0bacb0469e83c1e148908bd7d5a6010354cf4fb73279b7447422e3a89" +checksum = "df52b6d9b87e0c74c9edfa1eb2d9bf85e5d63515474513aa50fa181b3c4f5db1" dependencies = [ "cfg-if", "once_cell", @@ -4107,9 +4134,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.118" +version = "0.2.120" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eeff24f84126c0ec2db7a449f0c2ec963c6a49efe0698c4242929da037ca28ed" +checksum = "78b1041f495fb322e64aca85f5756b2172e35cd459376e67f2a6c9dffcedb103" dependencies = [ "quote 1.0.45", "wasm-bindgen-macro-support", @@ -4117,9 +4144,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.118" +version = "0.2.120" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d08065faf983b2b80a79fd87d8254c409281cf7de75fc4b773019824196c904" +checksum = "9dcd0ff20416988a18ac686d4d4d0f6aae9ebf08a389ff5d29012b05af2a1b41" dependencies = [ "bumpalo", "proc-macro2", @@ -4130,9 +4157,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-shared" -version = "0.2.118" +version = "0.2.120" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5fd04d9e306f1907bd13c6361b5c6bfc7b3b3c095ed3f8a9246390f8dbdee129" +checksum = "49757b3c82ebf16c57d69365a142940b384176c24df52a087fb748e2085359ea" dependencies = [ "unicode-ident", ] diff --git a/src/proxy/Cargo.toml b/src/proxy/Cargo.toml index d379c4a4..7d1ddef8 100644 --- a/src/proxy/Cargo.toml +++ b/src/proxy/Cargo.toml @@ -3,7 +3,7 @@ name = "efs-proxy" edition = "2021" build = "build.rs" # The version of efs-proxy is tied to efs-utils. -version = "3.1.0" +version = "3.1.1" publish = false license = "MIT" diff --git a/src/proxy/src/controller.rs b/src/proxy/src/controller.rs index 5056950f..b72dcf42 100644 --- a/src/proxy/src/controller.rs +++ b/src/proxy/src/controller.rs @@ -10,6 +10,7 @@ use crate::{ config::channel_init_config::ChannelInitConfig, config_parser::ProxyConfig, connections::{configure_stream, PartitionFinder, ProxyStream}, + error::RpcError, proxy::Proxy, proxy_builder::ProxyBuilder, proxy_identifier::ProxyIdentifier, @@ -31,9 +32,9 @@ pub const DEFAULT_SCALE_UP_BACKOFF: Duration = Duration::from_secs(300); pub const DEFAULT_SCALE_UP_CONFIG: ScaleUpConfig = ScaleUpConfig { max_multiplexed_connections: 5, - scale_up_bytes_per_ms_threshold: 300 * 1024 * 1024 / 1000, - scale_up_threshold_breached_duration_ms: 1000, - scale_up_lookback_window_size_ms: 1000, + scale_up_bytes_per_sec_threshold: 300 * 1024 * 1024, + scale_up_threshold_breached_duration_sec: 1, + scale_up_lookback_window_size_sec: 1, }; #[derive(Debug)] @@ -179,6 +180,7 @@ impl Controller { let (status_events_tx, mut status_events_rx) = mpsc::channel(1024); let (shutdown, mut waiter) = ShutdownHandle::new(token.child_token()); + let used_reused_connections = ready_connections.is_some(); let (partition_id, mut partition_servers, scale_up_config) = match ready_connections { Some(connections) => { ready_connections = None; @@ -251,6 +253,11 @@ impl Controller { } Err(e) => { warn!("{e}"); + if used_reused_connections && matches!(&e, RpcError::ChannelInitTimeout) { + warn!("channel_init timed out on reused connections, restarting with fresh connections"); + ready_connections = None; + continue; + } ChannelInitConfig::default() } }; @@ -400,7 +407,7 @@ impl Controller { state.num_connections == 1 && state.connection_state == ConnectionSearchState::Idle && stats.get_total_throughput_per_second() - >= self.scale_up_config.scale_up_bytes_per_ms_threshold as u64 / 1000 + >= self.scale_up_config.scale_up_bytes_per_sec_threshold as u64 } async fn handle_event( diff --git a/src/proxy/src/error.rs b/src/proxy/src/error.rs index 61ce93f6..fbd0c631 100644 --- a/src/proxy/src/error.rs +++ b/src/proxy/src/error.rs @@ -46,4 +46,6 @@ pub enum RpcError { OncRpc(#[from] onc_rpc::Error), #[error("awsfile_channel_init rpc failed. Reason: `{0}`")] AwsFileChannelInitFailure(String), + #[error("awsfile_channel_init rpc timed out")] + ChannelInitTimeout, } diff --git a/src/proxy/src/xdr/awsfile_prot.x b/src/proxy/src/xdr/awsfile_prot.x index a6cbbcc4..c9c1dde8 100644 --- a/src/proxy/src/xdr/awsfile_prot.x +++ b/src/proxy/src/xdr/awsfile_prot.x @@ -29,9 +29,9 @@ struct ProxyIdentifier { struct ScaleUpConfig { int max_multiplexed_connections; - int scale_up_bytes_per_ms_threshold; - int scale_up_threshold_breached_duration_ms; - int scale_up_lookback_window_size_ms; + int scale_up_bytes_per_sec_threshold; + int scale_up_threshold_breached_duration_sec; + int scale_up_lookback_window_size_sec; }; enum BindResponseType { diff --git a/src/watchdog/__init__.py b/src/watchdog/__init__.py index d4881598..14cf7d04 100755 --- a/src/watchdog/__init__.py +++ b/src/watchdog/__init__.py @@ -56,7 +56,7 @@ AMAZON_LINUX_2_RELEASE_ID, AMAZON_LINUX_2_PRETTY_NAME, ] -VERSION = "3.1.0" +VERSION = "3.1.1" SERVICE = "elasticfilesystem" FS_PREFIX = "fs-" @@ -976,8 +976,9 @@ def get_system_release_version(): try: with open(OS_RELEASE_PATH) as f: for line in f: - if "PRETTY_NAME" in line: - value = line.split("=")[1].strip() + line = line.strip() + if line.startswith("PRETTY_NAME="): + value = line.split("=", 1)[1].strip() return value.strip('"').strip("'") except IOError: logging.debug("Unable to read %s", OS_RELEASE_PATH) diff --git a/test/mount_common_test/test_helper_function.py b/test/mount_common_test/test_helper_function.py index 9989e555..590f596b 100644 --- a/test/mount_common_test/test_helper_function.py +++ b/test/mount_common_test/test_helper_function.py @@ -524,6 +524,28 @@ def test_get_system_release_version_linux_read_from_os_release_path(mocker): utils.assert_called_n_times(open_mock, 2) +@unittest.skipIf(sys.version_info[1] < 7, "Not supported in python3.6 and below.") +def test_get_system_release_version_linux_os_release_with_comment_containing_pretty_name( + mocker, +): + """SUSE SLES 16 has a comment line mentioning PRETTY_NAME before the actual key.""" + mocker.patch( + "efs_utils_common.platform_utils.check_if_platform_is_mac", return_value=False + ) + os_release_content = ( + "# The NAME and PRETTY_NAME fields have been chosen for compatibility.\n" + 'PRETTY_NAME="SUSE Linux Enterprise Server 16.0"\n' + ) + mock = mock_open() + mock.side_effect = [ + FileNotFoundError, + mock_open(read_data=os_release_content).return_value, + ] + mocker.patch("builtins.open", mock) + result = platform_utils.get_system_release_version() + assert result == "SUSE Linux Enterprise Server 16.0" + + def test_get_system_release_version_linux_unknown(mocker): mocker.patch( "efs_utils_common.platform_utils.check_if_platform_is_mac", return_value=False