Notify io_service before forking (for pausing) python in bgp_stress_test

Bug #1603259 reported by Ananth Suryanarayana
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Juniper Openstack
Status tracked in Trunk
R3.0
Won't Fix
Medium
Ananth Suryanarayana
R3.1
Won't Fix
Medium
Ananth Suryanarayana
Trunk
Fix Committed
Medium
Ananth Suryanarayana

Bug Description

If io-service is not notified, fork() messes up ip read and write in the parent

diff --git a/src/bgp/test/bgp_stress_test.cc b/src/bgp/test/bgp_stress_test.cc
index 9d71e69..6b0d858 100644
--- a/src/bgp/test/bgp_stress_test.cc
+++ b/src/bgp/test/bgp_stress_test.cc
@@ -2520,9 +2520,14 @@ void BgpStressTest::Pause(string message) {
         return;
     cout << message;
     BGP_DEBUG_UT(message);
+
+ evm_.io_service()->notify_fork(boost::asio::io_service::fork_prepare);
     pid_t pid;
- if (!(pid = fork()))
+ if (!(pid = fork())) {
+ evm_.io_service()->notify_fork(boost::asio::io_service::fork_child);
         execl("/usr/bin/python", "/usr/bin/python", NULL);
+ }
+ evm_.io_service()->notify_fork(boost::asio::io_service::fork_parent);
     int status;
     waitpid(pid, &status, 0);
     HEAP_PROFILER_DUMP("bgp_stress_test");

Revision history for this message
OpenContrail Admin (ci-admin-f) wrote : [Review update] master

Review in progress for https://review.opencontrail.org/22025
Submitter: Ananth Suryanarayana (<email address hidden>)

Revision history for this message
OpenContrail Admin (ci-admin-f) wrote : [Review update] R3.1

Review in progress for https://review.opencontrail.org/22026
Submitter: Ananth Suryanarayana (<email address hidden>)

Revision history for this message
OpenContrail Admin (ci-admin-f) wrote : [Review update] R3.0

Review in progress for https://review.opencontrail.org/22027
Submitter: Ananth Suryanarayana (<email address hidden>)

Revision history for this message
OpenContrail Admin (ci-admin-f) wrote : [Review update] master

Review in progress for https://review.opencontrail.org/22025
Submitter: Ananth Suryanarayana (<email address hidden>)

Revision history for this message
OpenContrail Admin (ci-admin-f) wrote : [Review update] R3.1

Review in progress for https://review.opencontrail.org/22026
Submitter: Ananth Suryanarayana (<email address hidden>)

Revision history for this message
OpenContrail Admin (ci-admin-f) wrote : [Review update] R3.0

Review in progress for https://review.opencontrail.org/22027
Submitter: Ananth Suryanarayana (<email address hidden>)

Revision history for this message
OpenContrail Admin (ci-admin-f) wrote : A change has been merged

Reviewed: https://review.opencontrail.org/22025
Committed: http://github.org/Juniper/contrail-controller/commit/db07937455d0fde16ade37ad47170476f17ef724
Submitter: Zuul
Branch: master

commit db07937455d0fde16ade37ad47170476f17ef724
Author: Ananth Suryanarayana <email address hidden>
Date: Thu Jul 14 17:52:27 2016 -0700

Do fork() pythob safely in bgp_stress_test inorder to pause

boost asio io-service must be properly notified before forking any child process

Change-Id: Iad52c70381ec19c956161d13a55c355e61b98eb4
Closes-Bug: 1603259

Jeba Paulaiyan (jebap)
tags: added: scale
Jeba Paulaiyan (jebap)
tags: added: blocker contrail-control llgr
Revision history for this message
Ananth Suryanarayana (anantha-l) wrote :

This is a test specific issue and hence not a blocker. Also a work around has been found (to set an env variable) to continue testing

tags: removed: blocker
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.