Linux-LVM Archive mirror
 help / color / mirror / Atom feed
From: Abhishek Agarwal <mragarwal.developer@gmail.com>
To: linux-lvm@redhat.com
Subject: [linux-lvm] lvm commands hanging when run from inside a kubernetes pod
Date: Fri, 27 May 2022 12:32:24 +0530	[thread overview]
Message-ID: <CAM3OQJGWsYo=boQBHqmLj1HRRtg14p3-Tp3yeu7KMYcKV2_hOA@mail.gmail.com> (raw)


[-- Attachment #1.1: Type: text/plain, Size: 5602 bytes --]

When a kubernetes pod is scheduled on the node having lvm2 libraries
already installed and trying to run lvm commands using those node binaries
from inside the pod container, the commands hang and are waiting on
something to complete. Although when ctrl+c is pressed the terminal session
resumes and checking the final code for the execution returns a "0" error
code and the commands operation is also carried out successfully.


Below is the command output and strace for the command:-

strace of lvcreate on the pod container scheduled on the node where lvm2
binaries are present:
# strace /sbin/lvm-eg/lvcreate -n test-lv -L 1G shared-vg
execve("/sbin/lvm-eg/lvcreate", ["/sbin/lvm-eg/lvcreate", "-n", "test-lv",
"-L", "1G", "shared-vg"], 0x7ffe7d7a6c98 /* 37 vars */) = 0
brk(NULL)                = 0x55d196f41000
arch_prctl(0x3001 /* ARCH_??? */, 0x7ffdd8247a80) = -1 EINVAL (Invalid
argument)
access("/etc/ld.so.preload", R_OK)   = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=8679, ...}) = 0
mmap(NULL, 8679, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7f0d37895000
close(3)                = 0
openat(AT_FDCWD, "/lib/x86_64-linux-gnu/libc.so.6", O_RDONLY|O_CLOEXEC) = 3
read(3,
"\177ELF\2\1\1\3\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\360A\2\0\0\0\0\0"..., 832)
= 832
pread64(3, "\6\0\0\0\4\0\0\0@\0\0\0\0\0\0\0@\0\0\0\0\0\0\0@\0\0\0\0\0\0\0"...,
784, 64) = 784
pread64(3,
"\4\0\0\0\20\0\0\0\5\0\0\0GNU\0\2\0\0\300\4\0\0\0\3\0\0\0\0\0\0\0", 32,
848) = 32
pread64(3,
"\4\0\0\0\24\0\0\0\3\0\0\0GNU\0\237\333t\347\262\27\320l\223\27*\202C\370T\177"...,
68, 880) = 68
fstat(3, {st_mode=S_IFREG|0755, st_size=2029560, ...}) = 0
mmap(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) =
0x7f0d37893000
pread64(3, "\6\0\0\0\4\0\0\0@\0\0\0\0\0\0\0@\0\0\0\0\0\0\0@\0\0\0\0\0\0\0"...,
784, 64) = 784
pread64(3,
"\4\0\0\0\20\0\0\0\5\0\0\0GNU\0\2\0\0\300\4\0\0\0\3\0\0\0\0\0\0\0", 32,
848) = 32
pread64(3,
"\4\0\0\0\24\0\0\0\3\0\0\0GNU\0\237\333t\347\262\27\320l\223\27*\202C\370T\177"...,
68, 880) = 68
mmap(NULL, 2037344, PROT_READ, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) =
0x7f0d376a1000
mmap(0x7f0d376c3000, 1540096, PROT_READ|PROT_EXEC,
MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x22000) = 0x7f0d376c3000
mmap(0x7f0d3783b000, 319488, PROT_READ,
MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x19a000) = 0x7f0d3783b000
mmap(0x7f0d37889000, 24576, PROT_READ|PROT_WRITE,
MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x1e7000) = 0x7f0d37889000
mmap(0x7f0d3788f000, 13920, PROT_READ|PROT_WRITE,
MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7f0d3788f000
close(3)                = 0
arch_prctl(ARCH_SET_FS, 0x7f0d37894580) = 0
mprotect(0x7f0d37889000, 16384, PROT_READ) = 0
mprotect(0x55d196662000, 8192, PROT_READ) = 0
mprotect(0x7f0d378c5000, 4096, PROT_READ) = 0
munmap(0x7f0d37895000, 8679)      = 0
getuid()                = 0
getgid()                = 0
getpid()                = 19163
rt_sigaction(SIGCHLD, {sa_handler=0x55d196657c30, sa_mask=~[RTMIN RT_1],
sa_flags=SA_RESTORER, sa_restorer=0x7f0d376e40c0}, NULL, 8) = 0
geteuid()                = 0
brk(NULL)                = 0x55d196f41000
brk(0x55d196f62000)           = 0x55d196f62000
getppid()                = 19160
stat("/", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
stat(".", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
openat(AT_FDCWD, "/sbin/lvm-eg/lvcreate", O_RDONLY) = 3
fcntl(3, F_DUPFD, 10)          = 10
close(3)                = 0
fcntl(10, F_SETFD, FD_CLOEXEC)     = 0
geteuid()                = 0
getegid()                = 0
rt_sigaction(SIGINT, NULL, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=0}, 8)
= 0
rt_sigaction(SIGINT, {sa_handler=0x55d196657c30, sa_mask=~[RTMIN RT_1],
sa_flags=SA_RESTORER, sa_restorer=0x7f0d376e40c0}, NULL, 8) = 0
rt_sigaction(SIGQUIT, NULL, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=0},
8) = 0
rt_sigaction(SIGQUIT, {sa_handler=SIG_DFL, sa_mask=~[RTMIN RT_1],
sa_flags=SA_RESTORER, sa_restorer=0x7f0d376e40c0}, NULL, 8) = 0
rt_sigaction(SIGTERM, NULL, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=0},
8) = 0
rt_sigaction(SIGTERM, {sa_handler=SIG_DFL, sa_mask=~[RTMIN RT_1],
sa_flags=SA_RESTORER, sa_restorer=0x7f0d376e40c0}, NULL, 8) = 0
read(10, "#!/bin/sh\npath=$(/sbin/lvm-eg/ge"..., 8192) = 79
pipe([3, 4])              = 0
clone(child_stack=NULL,
flags=CLONE_CHILD_CLEARTID|CLONE_CHILD_SETTID|SIGCHLD,
child_tidptr=0x7f0d37894850) = 19164
close(4)                = 0
read(3, "/usr/sbin/lvcreate\n", 128)  = 19
--- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=19164, si_uid=0,
si_status=0, si_utime=0, si_stime=0} ---
rt_sigreturn({mask=[]})         = 19
read(3, "", 128)            = 0
close(3)                = 0
wait4(-1, [{WIFEXITED(s) && WEXITSTATUS(s) == 0}], 0, NULL) = 19164
stat("/usr/local/sbin/chroot", 0x7ffdd8247710) = -1 ENOENT (No such file or
directory)
stat("/usr/local/bin/chroot", 0x7ffdd8247710) = -1 ENOENT (No such file or
directory)
stat("/usr/sbin/chroot", {st_mode=S_IFREG|0755, st_size=43352, ...}) = 0
clone(child_stack=NULL,
flags=CLONE_CHILD_CLEARTID|CLONE_CHILD_SETTID|SIGCHLD,
child_tidptr=0x7f0d37894850) = 19168
wait4(-1, ^Cstrace: Process 19163 detached
 <detached ...>

# ^C

`lvs` output on the node after pressing ctrl+c on the pod
container's terminal:
ubuntu@ip-172-31-85-197:~$ sudo lvs
 LV                    VG       Attr    LSize  Pool      Origin Data% Meta%
Move Log Cpy%Sync Convert
 test-lv                 shared-vg    -wi-a-----  1.00g

If ctrl+c is not pressed and trying to see the above output on the node
also hangs until the pod operation is interrupted.

[-- Attachment #1.2: Type: text/html, Size: 6457 bytes --]

[-- Attachment #2: Type: text/plain, Size: 202 bytes --]

_______________________________________________
linux-lvm mailing list
linux-lvm@redhat.com
https://listman.redhat.com/mailman/listinfo/linux-lvm
read the LVM HOW-TO at http://tldp.org/HOWTO/LVM-HOWTO/

             reply	other threads:[~2022-05-30  6:52 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-27  7:02 Abhishek Agarwal [this message]
2022-05-30 11:55 ` [linux-lvm] lvm commands hanging when run from inside a kubernetes pod Roger Heflin
2022-05-31 18:50   ` Abhishek Agarwal
2022-06-01  7:26     ` Demi Marie Obenour
2022-06-01  8:28       ` Abhishek Agarwal
2022-06-02 11:04         ` Roger Heflin
2022-06-06  5:49           ` Abhishek Agarwal
2022-06-06  7:01             ` Demi Marie Obenour
2022-06-06 11:31               ` Abhishek Agarwal
2022-06-07 17:42                 ` Demi Marie Obenour
2022-06-06  7:02             ` Bernd Eckenfels
2022-06-02 19:00         ` Nir Soffer
2022-05-30 15:15 ` Zdenek Kabelac
2022-05-30 15:15   ` Zdenek Kabelac

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='CAM3OQJGWsYo=boQBHqmLj1HRRtg14p3-Tp3yeu7KMYcKV2_hOA@mail.gmail.com' \
    --to=mragarwal.developer@gmail.com \
    --cc=linux-lvm@redhat.com \
    /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 read-only IMAP folder(s) and NNTP newsgroup(s).