netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stephen Hemminger <stephen@networkplumber.org>
To: netdev@vger.kernel.org
Subject: Fw: [Bug 215793] New: ip netns del is asynchronous??? -- very unexpected and puzzling
Date: Tue, 5 Apr 2022 10:23:50 -0700	[thread overview]
Message-ID: <20220405102350.61dce151@hermes.local> (raw)



Begin forwarded message:

Date: Sat, 02 Apr 2022 12:14:36 +0000
From: bugzilla-daemon@kernel.org
To: stephen@networkplumber.org
Subject: [Bug 215793] New: ip netns del is asynchronous??? -- very unexpected and puzzling


https://bugzilla.kernel.org/show_bug.cgi?id=215793

            Bug ID: 215793
           Summary: ip netns del is asynchronous??? -- very unexpected and
                    puzzling
           Product: Networking
           Version: 2.5
    Kernel Version: 5.10.106
          Hardware: All
                OS: Linux
              Tree: Mainline
            Status: NEW
          Severity: normal
          Priority: P1
         Component: Other
          Assignee: stephen@networkplumber.org
          Reporter: rm+bko@romanrm.net
        Regression: No

Hello,

I have a script like this:

  ip netns del test-ns
  ip netns add test-ns
  ip link add tun-test type gre local any remote 8.8.8.8
  ip link set tun-test netns test-ns

As is, the script will fail exactly every other time:

---------------
# ./nstest.sh 
RTNETLINK answers: File exists
Cannot find device "tun-test"

# ./nstest.sh 

# ./nstest.sh 
RTNETLINK answers: File exists
Cannot find device "tun-test"

# ./nstest.sh 

# ./nstest.sh 
RTNETLINK answers: File exists
Cannot find device "tun-test"

# ./nstest.sh 

# ./nstest.sh 
RTNETLINK answers: File exists
Cannot find device "tun-test"

# ./nstest.sh 

# ./nstest.sh 
RTNETLINK answers: File exists
Cannot find device "tun-test"

# ./nstest.sh 

# ./nstest.sh 
RTNETLINK answers: File exists
Cannot find device "tun-test"

---------------
That's because "ip netns del" seems to return without actually finishing to
fully delete the NS. Adding a "sleep 1" after the first line, makes the script
complete successfully every time. This is a very unexpected behavior. I would
ask for a better workaround than "sleep 1", but I believe there should be no
workaround, and the script should reliably work as posted.

Hope you can consider changing this.

Thanks!

-- 
You may reply to this email to add a comment.

You are receiving this mail because:
You are the assignee for the bug.

                 reply	other threads:[~2022-04-05 20:15 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220405102350.61dce151@hermes.local \
    --to=stephen@networkplumber.org \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).