Skip to content
This repository has been archived by the owner on Jun 23, 2022. It is now read-only.

Commit

Permalink
fix(network): use derror rather than dwarn for failed network bootstr…
Browse files Browse the repository at this point in the history
…ap (#300)
  • Loading branch information
Wu Tao authored and HuangWei committed Aug 27, 2019
1 parent 7ff1140 commit c3c1326
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 14 deletions.
8 changes: 4 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ language: cpp

os: linux

compiler:
compiler:
- gcc

cache:
Expand All @@ -18,7 +18,7 @@ addons:
- clang-format-3.9

before_install:
- wget https://media.githubusercontent.com/media/XiaoMi/pegasus-common/master/build-depends.tar.gz
- wget https://github.com/XiaoMi/pegasus-common/releases/download/deps/build-depends.tar.gz
- tar xfz build-depends.tar.gz
- rm -f build-depends.tar.gz
- cd packages
Expand All @@ -27,8 +27,8 @@ before_install:

before_script:
- cd thirdparty
- wget https://media.githubusercontent.com/media/XiaoMi/pegasus-common/master/pegasus-thirdparty-prebuild.tar.gz
- tar xfz pegasus-thirdparty-prebuild.tar.gz
- wget https://github.com/XiaoMi/pegasus-common/releases/download/deps/pegasus-thirdparty-prebuild.tar.gz
- tar xf pegasus-thirdparty-prebuild.tar.gz
- rm -f pegasus-thirdparty-prebuild.tar.gz
- cd ..
- ulimit -c unlimited -S
Expand Down
4 changes: 2 additions & 2 deletions scripts/linux/start_zk.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ if [ ! -f zookeeper-3.4.6.tar.gz ]; then
download_url="http://git.n.xiaomi.com/pegasus/packages/raw/master/zookeeper-3.4.6.tar.gz"
wget -T 5 -t 1 $download_url
if [ $? -ne 0 ]; then
download_url="https://github.com/xiaomi/pegasus-common/raw/master/zookeeper-3.4.6.tar.gz"
download_url="https://github.com/XiaoMi/pegasus-common/releases/download/deps/zookeeper-3.4.6.tar.gz"
wget -T 5 -t 1 $download_url
if [ $? -ne 0 ]; then
echo "ERROR: download zookeeper failed"
Expand All @@ -41,7 +41,7 @@ fi

if [ ! -d zookeeper-3.4.6 ]; then
echo "Decompressing zookeeper..."
tar xfz zookeeper-3.4.6.tar.gz
tar xf zookeeper-3.4.6.tar.gz
if [ $? -ne 0 ]; then
echo "ERROR: decompress zookeeper failed"
exit 1
Expand Down
16 changes: 8 additions & 8 deletions src/core/tools/common/asio_net_provider.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -336,15 +336,15 @@ error_code asio_udp_provider::start(rpc_channel channel, int port, bool client_o
_socket.reset(new ::boost::asio::ip::udp::socket(_io_service));
_socket->open(endpoint.protocol(), ec);
if (ec) {
dwarn("asio udp socket open failed, error = %s", ec.message().c_str());
derror("asio udp socket open failed, error = %s", ec.message().c_str());
_socket.reset();
continue;
}
_socket->bind(endpoint, ec);
if (ec) {
dwarn("asio udp socket bind failed, port = %u, error = %s",
_address.port(),
ec.message().c_str());
derror("asio udp socket bind failed, port = %u, error = %s",
_address.port(),
ec.message().c_str());
_socket.reset();
continue;
}
Expand All @@ -358,15 +358,15 @@ error_code asio_udp_provider::start(rpc_channel channel, int port, bool client_o
_socket.reset(new ::boost::asio::ip::udp::socket(_io_service));
_socket->open(endpoint.protocol(), ec);
if (ec) {
dwarn("asio udp socket open failed, error = %s", ec.message().c_str());
derror("asio udp socket open failed, error = %s", ec.message().c_str());
_socket.reset();
return ERR_NETWORK_INIT_FAILED;
}
_socket->bind(endpoint, ec);
if (ec) {
dwarn("asio udp socket bind failed, port = %u, error = %s",
_address.port(),
ec.message().c_str());
derror("asio udp socket bind failed, port = %u, error = %s",
_address.port(),
ec.message().c_str());
_socket.reset();
return ERR_NETWORK_INIT_FAILED;
}
Expand Down

0 comments on commit c3c1326

Please sign in to comment.