diff mbox

[ovs-dev,v3,RFC] ovs-lib: try to call exit before killing

Message ID 1450269141-27603-1-git-send-email-i.maximets@samsung.com
State Accepted
Headers show

Commit Message

Ilya Maximets Dec. 16, 2015, 12:32 p.m. UTC
While killing OVS may not free all allocated resources.

Eample:
	Socket for vhost-user port will stay in a system
	after 'systemctl stop openvswitch' and opening
	that port after restart will fail.

Signed-off-by: Ilya Maximets <i.maximets@samsung.com>
---

version 3:
	* sleep after EXIT splitted.

version 2:
	* added '-T 1'
	* '-t $1' --> '-t $rundir/$1.$pid.ctl'

 utilities/ovs-lib.in | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

Comments

Ben Pfaff Dec. 16, 2015, 12:38 p.m. UTC | #1
On Wed, Dec 16, 2015 at 03:32:21PM +0300, Ilya Maximets wrote:
> While killing OVS may not free all allocated resources.
> 
> Eample:
> 	Socket for vhost-user port will stay in a system
> 	after 'systemctl stop openvswitch' and opening
> 	that port after restart will fail.
> 
> Signed-off-by: Ilya Maximets <i.maximets@samsung.com>

Applied to master.  Thank you!
Christian Ehrhardt Jan. 26, 2016, 10:15 a.m. UTC | #2
Ben Pfaff <blp@...> writes:

> 
> On Wed, Dec 16, 2015 at 03:32:21PM +0300, Ilya Maximets wrote:
> > While killing OVS may not free all allocated resources.
> > 
> > Eample:
> > 	Socket for vhost-user port will stay in a system
> > 	after 'systemctl stop openvswitch' and opening
> > 	that port after restart will fail.
> > 
> > Signed-off-by: Ilya Maximets <i.maximets <at> samsung.com>
> 
> Applied to master.  Thank you!

Hi,
I had trouble caused by the same issue. After some debugging I found the 
underlying reasons and after that was clear I had the right search terms to 
find this patch from Ilya that already existed to fix it.

My OVS is built from branch-2.5 as I try to prepare for its release and 
ensure everything is working. So I realized that Ilyas fix is only on master 
so far. As an experiment I manually patched it into my system and it is 
working fine now.

Therefore I wanted to ask if there are any objections to apply it to branch-
2.5 as well?
Ben Pfaff Jan. 26, 2016, 4:10 p.m. UTC | #3
On Tue, Jan 26, 2016 at 10:15:35AM +0000, Christian Ehrhardt wrote:
> Ben Pfaff <blp@...> writes:
> 
> > 
> > On Wed, Dec 16, 2015 at 03:32:21PM +0300, Ilya Maximets wrote:
> > > While killing OVS may not free all allocated resources.
> > > 
> > > Eample:
> > > 	Socket for vhost-user port will stay in a system
> > > 	after 'systemctl stop openvswitch' and opening
> > > 	that port after restart will fail.
> > > 
> > > Signed-off-by: Ilya Maximets <i.maximets <at> samsung.com>
> > 
> > Applied to master.  Thank you!
> 
> Hi,
> I had trouble caused by the same issue. After some debugging I found the 
> underlying reasons and after that was clear I had the right search terms to 
> find this patch from Ilya that already existed to fix it.
> 
> My OVS is built from branch-2.5 as I try to prepare for its release and 
> ensure everything is working. So I realized that Ilyas fix is only on master 
> so far. As an experiment I manually patched it into my system and it is 
> working fine now.
> 
> Therefore I wanted to ask if there are any objections to apply it to branch-
> 2.5 as well?

Done.
diff mbox

Patch

diff --git a/utilities/ovs-lib.in b/utilities/ovs-lib.in
index dd8a1e9..773efb3 100644
--- a/utilities/ovs-lib.in
+++ b/utilities/ovs-lib.in
@@ -202,11 +202,18 @@  start_daemon () {
 stop_daemon () {
     if test -e "$rundir/$1.pid"; then
         if pid=`cat "$rundir/$1.pid"`; then
-            for action in TERM .1 .25 .65 1 1 1 1 KILL 1 1 1 2 10 15 30 FAIL; do
+            for action in EXIT .1 .25 .65 1 \
+                          TERM .1 .25 .65 1 1 1 1 \
+                          KILL 1 1 1 2 10 15 30 \
+                          FAIL; do
                 if pid_exists "$pid" >/dev/null 2>&1; then :; else
                     return 0
                 fi
                 case $action in
+                    EXIT)
+                        action "Exiting $1 ($pid)" \
+                            ${bindir}/ovs-appctl -T 1 -t $rundir/$1.$pid.ctl exit
+                        ;;
                     TERM)
                         action "Killing $1 ($pid)" kill $pid
                         ;;