Page MenuHomePhabricator

Error in commit causes hung 'sudo write' threads
Open, NormalPublic

Description

It appears that when a config change commit is initiated, but is unsuccessful in completion (for one of a few reasons), a hung thread for 'sudo write' to return a message to the pty of the user committing the change occurs.

The configuration subsystem then becomes inoperable until hung threads are cleaned up.

bbabich@pauseq4rbdr1# commit
^C^C^C
^Z
[1]+  Stopped                 /opt/vyatta/sbin/my_commit "${args[@]}" 2>&1
[edit]
bbabich@pauseq4rbdr1# ps -ef | grep -i commit
bbabich  35765 35503  0 00:29 pts/0    00:00:00 /opt/vyatta/sbin/my_commit
bbabich  35923 35503  0 00:30 pts/0    00:00:00 grep -i commit
[edit]
bbabich@pauseq4rbdr1# kill -9 35765
[edit]
bbabich@pauseq4rbdr1# compare
[1]+  Killed                  /opt/vyatta/sbin/my_commit "${args[@]}" 2>&1
...

bbabich@pauseq4rbdr1:~$ ps -ef | grep -i bbabich
root     10974  2753  0 Jan04 ?        00:00:00 sshd: bbabich [priv]
bbabich  10982 10974  0 Jan04 ?        00:00:00 sshd: bbabich@pts/2
bbabich  10983 10982  0 Jan04 pts/2    00:00:00 -vbash
bbabich  11102 11101  0 Jan04 pts/2    00:00:00 vbash
root     22485     1  0 Jan04 ?        00:00:00 sudo write bbabich pts/2
root     22486 22485  0 Jan04 ?        00:00:00 write bbabich pts/2
root     22922  2753  0 Jan04 ?        00:00:00 sshd: bbabich [priv]
bbabich  22928 22922  0 Jan04 ?        00:00:00 sshd: bbabich@pts/1
bbabich  22929 22928  0 Jan04 pts/1    00:00:00 -vbash
root     25712     1  0 Jan04 ?        00:00:00 sudo write bbabich pts/2
root     25713 25712  0 Jan04 ?        00:00:00 write bbabich pts/2
root     26430     1  0 Jan04 ?        00:00:00 sudo write bbabich pts/2
root     26431 26430  0 Jan04 ?        00:00:00 write bbabich pts/2
root     27135     1  0 Jan04 ?        00:00:00 sudo write bbabich pts/2
root     27136 27135  0 Jan04 ?        00:00:00 write bbabich pts/2
root     28109     1  0 Jan04 ?        00:00:00 sudo write bbabich pts/2
root     28110 28109  0 Jan04 ?        00:00:00 write bbabich pts/2
root     28663     1  0 Jan04 ?        00:00:00 sudo write bbabich pts/2
root     28664 28663  0 Jan04 ?        00:00:00 write bbabich pts/2
root     29526     1  0 Jan04 ?        00:00:00 sudo write bbabich pts/2
root     29527 29526  0 Jan04 ?        00:00:00 write bbabich pts/2
root     30490     1  0 Jan04 ?        00:00:00 sudo write bbabich pts/2
root     30491 30490  0 Jan04 ?        00:00:00 write bbabich pts/2
root     30819     1  0 Jan04 ?        00:00:00 sudo write bbabich pts/2
root     30820 30819  0 Jan04 ?        00:00:00 write bbabich pts/2
root     33242     1  0 00:09 ?        00:00:00 sudo write bbabich pts/2
root     33243 33242  0 00:09 ?        00:00:00 write bbabich pts/2
root     34145     1  0 00:15 ?        00:00:00 sudo write bbabich pts/2
root     34146 34145  0 00:15 ?        00:00:00 write bbabich pts/2
root     34648     1  0 00:20 ?        00:00:00 sudo write bbabich pts/2
root     34649 34648  0 00:20 ?        00:00:00 write bbabich pts/2
root     35377  2753  0 00:28 ?        00:00:00 sshd: bbabich [priv]
bbabich  35381 35377  0 00:28 ?        00:00:00 sshd: bbabich@pts/0
bbabich  35382 35381  0 00:28 pts/0    00:00:00 -vbash
root     35812     1  0 00:29 pts/0    00:00:00 sudo write bbabich pts/2
root     35813 35812  0 00:29 pts/0    00:00:00 write bbabich pts/2
root     49999     1  0 03:30 pts/0    00:00:00 sudo write bbabich pts/2
root     50000 49999  0 03:30 pts/0    00:00:00 write bbabich pts/2
root     53824 53811  0 04:22 pts/1    00:00:00 sudo write bbabich pts/2
root     53825 53824  0 04:22 pts/1    00:00:00 write bbabich pts/2
bbabich  54033 35382  0 04:25 pts/0    00:00:00 ps -ef
bbabich  54034 35382  0 04:25 pts/0    00:00:00 grep -i bbabich
bbabich@pauseq4rbdr1:~$ ps -ef | grep -i bbabich | awk '{print $2}' | xargs kill
Connection to 10.0.222.141 closed by remote host.
Connection to 10.0.222.141 closed.
...

Details

Difficulty level
Unknown (require assessment)
Version
VyOS 1.2.4
Why the issue appeared?
Will be filled on close
Is it a breaking change?
Perfectly compatible

Event Timeline

bbabich created this task.Jan 5 2020, 8:00 AM
bbabich created this object in space S1 VyOS Public.
syncer assigned this task to dmbaturin.Jan 6 2020, 12:40 AM
syncer triaged this task as Normal priority.
syncer added a project: VyOS 1.3 Equuleus.
pasik added a subscriber: pasik.Jan 6 2020, 12:26 PM
Alfa80 added a subscriber: Alfa80.Jan 18 2020, 2:09 PM