Skip to content

Commit

Permalink
server: using thread queue to unlink brick edge
Browse files Browse the repository at this point in the history
Using link and unlink on two different thread, cause some problem.
This fix use the same thread to link and unlink brick edge.

Signed-off-by: Thiery Ouattara <[email protected]>
  • Loading branch information
outscale-toa committed Feb 21, 2020
1 parent 2de7abd commit 7d571bc
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 8 deletions.
6 changes: 1 addition & 5 deletions api/server/graph.cc
Original file line number Diff line number Diff line change
Expand Up @@ -823,11 +823,7 @@ bool Graph::NicAdd(app::Nic *nic_) {
}

BrickShrPtr head1 = vni.nics.begin()->second.head;
if (pg_brick_unlink_edge(vtep_.get(), head1.get(),
&app::pg_error) < 0) {
PG_ERROR_(app::pg_error);
return false;
}
unlink_edge(vtep_, head1);
link(vtep_, vni.sw);
add_vni(vtep_, vni.sw, nic.vni);
link(vni.sw, head1);
Expand Down
2 changes: 1 addition & 1 deletion scripts/tests_all.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ fi
sleep 1

# Crypto test
$BUTTERFLY_ROOT/scripts/tests_crypto.sh $BUTTERFLY_BUILD_ROOT/build
$BUTTERFLY_ROOT/scripts/tests_crypto.sh $BUTTERFLY_BUILD_ROOT
if [ $? != 0 ]; then
tput setaf 1
echo "crypto test failed"
Expand Down
2 changes: 1 addition & 1 deletion scripts/tests_crypto.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
BT_BUILD=$1

cd $BT_BUILD
g++ -std=c++11 -lcrypto -DUNIT_TESTS -I../ ../api/common/crypto.cc -o crypto
g++ ../api/common/crypto.cc -std=c++11 -lcrypto -DUNIT_TESTS -I ../ -o crypto
./crypto
RET=$?
rm crypto
Expand Down
4 changes: 3 additions & 1 deletion tests/functions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -831,7 +831,9 @@ function do_kill {
function server_stop {
id=$1
echo "[butterfly-$id] stopping"
do_kill 1 -15
sudo kill -15 $(ps --ppid ${server_pids[$id]} -o pid=) &> /dev/null
sleep 0.2
sudo kill -s 0 ${server_pids[$id]} &> /dev/null
if [ "$?" != "1" ]; then
for t in {1..3}; do
sudo pkill -9 -f but$id &> /dev/null
Expand Down

0 comments on commit 7d571bc

Please sign in to comment.