Skip to content
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

Adding double quotes #79

Merged
merged 7 commits into from
Sep 8, 2023
Merged

Conversation

palashvij-msft
Copy link
Collaborator

Bug on line 140 in aznfswatchdog script: [: too many arguments
if [ $? -eq 0 -a $conntrack_timeo_timew -gt $AZNFS_TIMEWAIT_TIMEOUT ]; then

Solution:
Wrap the variable in double quotes, forcing it to stay as one string (therefore one argument).

@palashvij-msft palashvij-msft requested review from a team and cagrawal-msft August 24, 2023 19:29
@@ -137,7 +137,7 @@ conntrack -L > /dev/null

# conntrack timewait timeout higher than the TCP timewait timeout value isn't very valuable.
conntrack_timeo_timew=$(cat /proc/sys/net/netfilter/nf_conntrack_tcp_timeout_time_wait 2>/dev/null)
if [ $? -eq 0 -a $conntrack_timeo_timew -gt $AZNFS_TIMEWAIT_TIMEOUT ]; then
Copy link
Contributor

@linuxsmiths linuxsmiths Aug 25, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is actually a correct statement. There are two reasons it might be failing:

  1. Older versions of bash may not be handling it fine. I don't know about this, but this is a possibility.
  2. The second possibility is that one of $conntrack_timeo_timew and $AZNFS_TIMEWAIT_TIMEOUT are null. Since AZNFS_TIMEWAIT_TIMEOUT is defined explicitly, this means conntrack_timeo_timew could be the one undefined, which means the above statement is yielding an empty value. This means netfilter module is not loaded and/or not present. In this case even the current code that you updated will also fail.

let's discuss this

src/aznfswatchdog Outdated Show resolved Hide resolved
src/aznfswatchdog Outdated Show resolved Hide resolved
src/aznfswatchdog Outdated Show resolved Hide resolved
src/aznfswatchdog Show resolved Hide resolved
src/aznfswatchdog Outdated Show resolved Hide resolved
src/aznfswatchdog Outdated Show resolved Hide resolved
@linuxsmiths linuxsmiths merged commit 0505b07 into main Sep 8, 2023
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants