Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Install Script Returns Non-Zero Code #1

Closed
jamescarr opened this issue Sep 17, 2014 · 2 comments
Closed

Install Script Returns Non-Zero Code #1

jamescarr opened this issue Sep 17, 2014 · 2 comments

Comments

@jamescarr
Copy link

Great piece of work here, finally got this building as a docker image successfully. 👍

Unfortunately the script at https://github.com/facebook/mcrouter/blob/master/mcrouter/scripts/get_and_build_everything.sh returns a non-zero code which can make things difficult for those using this with an automated build. For me, it meant that an hour long compile process ended in failure with

2014/09/17 03:25:48 The command [/bin/sh -c cd /tmp/mcrouter/mcrouter/scripts  && ./install_ubuntu_14.04.sh /usr/local/lib] returned a non-zero code: 3

This script should return 0 on success.

@alikhtarov
Copy link
Contributor

Thanks! This is due to the last line ("$INSTALL_DIR/bin/mcrouter" --help), you can simply remove it as a workaround. I will fix this in the trunk as well.

@alikhtarov
Copy link
Contributor

Fixed as of 3841348

pavlo-fb pushed a commit that referenced this issue Sep 26, 2014
Summary:
there is no point in returning "Unrecoverable error" exit code when someone wants to check command line options.
This fixes issue #1 :-) #1

Test Plan: ./mcrouter --help; echo $?

Reviewed By: alikhtarov@fb.com

Subscribers: alikhtarov

FB internal diff: D1560464
facebook-github-bot pushed a commit that referenced this issue Mar 26, 2020
Summary:
The simple cross region failover routes request to a region based on region names in -
1. Failover region names list
2. The master region in the request

At mcrouter configuration time, we make sure that failover region names have corresponding routes for #1. However #2 could be a bogus region name or a region name that is valid but has no route (as is the case for tnightly). In that case we were asserting too early, when checking if master region has a route. This change moves the assert to later after we've checked that master region has a route and marked it visited if its a bad value for which there's no route.

Differential Revision: D20671368

fbshipit-source-id: 5cfcdd9322af8ccbafdd55b3de06bb08b357b02f
facebook-github-bot referenced this issue Aug 4, 2020
Summary:
fbthrift commit facebook/fbthrift@0d079b3 broke mcrouter OSS compilation by introducing a new `rpcmetadata` library target, which causes mcrouter build to fail e.g. https://travis-ci.org/github/facebook/mcrouter/jobs/713583896

<details>
    <summary>mcrouter build error symptom</summary>

    ```
    /bin/bash ./libtool  --tag=CXX   --mode=link g++  -DLIBMC_FBTRACE_DISABLE -DDISABLE_COMPRESSION  -Wno-missing-field-initializers -Wno-deprecated -W -Wall -Wextra -Wno-unused-parameter -fno-strict-aliasing -g -O2  -L/home/travis/build/facebook/mcrouter/mcrouter-install/install/lib -ljemalloc  -o mcrouter mcrouter-main.o mcrouter-StandaloneConfig.o mcrouter-StandaloneUtils.o libmcroutercore.a lib/libmcrouter.a -lthriftcpp2 -ltransport -lthriftprotocol -lasync -lconcurrency -lprotocol -lthrift-core -lfmt -lwangle -lfolly -lfizz -lsodium -lfolly -ldl -ldouble-conversion -lz -lssl -lcrypto -levent -lgflags -lglog  -L/usr/lib/x86_64-linux-gnu -lboost_context -lboost_filesystem       -lboost_program_options -lboost_system -lboost_regex       -lboost_thread -lpthread -pthread -ldl -lunwind       -lbz2 -llz4 -llzma -lsnappy -lzstd

    libtool: link: g++ -DLIBMC_FBTRACE_DISABLE -DDISABLE_COMPRESSION -Wno-missing-field-initializers -Wno-deprecated -W -Wall -Wextra -Wno-unused-parameter -fno-strict-aliasing -g -O2 -o mcrouter mcrouter-main.o mcrouter-StandaloneConfig.o mcrouter-StandaloneUtils.o -pthread  -L/home/travis/build/facebook/mcrouter/mcrouter-install/install/lib -ljemalloc libmcroutercore.a lib/libmcrouter.a -lthriftcpp2 -ltransport -lthriftprotocol -lasync -lconcurrency -lprotocol -lthrift-core -lfmt -lwangle -lfizz -lsodium -lfolly -ldouble-conversion -lz -lssl -lcrypto -levent -lgflags -lglog -L/usr/lib/x86_64-linux-gnu -lboost_context -lboost_filesystem -lboost_program_options -lboost_system -lboost_regex -lboost_thread -lpthread -ldl -lunwind -lbz2 -llz4 -llzma -lsnappy -lzstd -pthread

    /home/travis/build/facebook/mcrouter/mcrouter-install/install/lib/libthriftcpp2.a(RocketClientChannel.cpp.o): In function `apache::thrift::(anonymous namespace)::decodeResponseError(apache::thrift::rocket::RocketException&&, unsigned short, folly::Range<char const*>)':

    RocketClientChannel.cpp:(.text+0x5fd): undefined reference to `apache::thrift::ResponseRpcError::ResponseRpcError()'

    RocketClientChannel.cpp:(.text+0x8db): undefined reference to `apache::thrift::ResponseRpcMetadata::ResponseRpcMetadata()'

    RocketClientChannel.cpp:(.text+0xe8a): undefined reference to `apache::thrift::ResponseRpcMetadata::~ResponseRpcMetadata()'

    RocketClientChannel.cpp:(.text+0xe99): undefined reference to `apache::thrift::ResponseRpcMetadata::~ResponseRpcMetadata()'

    RocketClientChannel.cpp:(.text+0xeb7): undefined reference to `apache::thrift::ResponseRpcError::~ResponseRpcError()'

    /home/travis/build/facebook/mcrouter/mcrouter-install/install/lib/libthriftcpp2.a(RocketClientChannel.cpp.o): In function `apache::thrift::RocketClientChannel::makeSetupFrame(apache::thrift::RequestSetupMetadata)':

    RocketClientChannel.cpp:(.text+0x3abb): undefined reference to `unsigned int apache::thrift::RequestSetupMetadata::write<apache::thrift::CompactProtocolWriter>(apache::thrift::CompactProtocolWriter*) const'

    RocketClientChannel.cpp:(.text+0x3ad4): undefined reference to `unsigned int apache::thrift::RequestSetupMetadata::serializedSize<apache::thrift::CompactProtocolWriter>(apache::thrift::CompactProtocolWriter const*) const'

    /home/travis/build/facebook/mcrouter/mcrouter-install/install/lib/libthriftcpp2.a(RocketClientChannel.cpp.o): In function `apache::thrift::RocketClientChannel::sendRequestStream(apache::thrift::RpcOptions const&, folly::Range<char const*>, apache::thrift::SerializedRequest&&, std::shared_ptr<apache::thrift::transport::THeader>, apache::thrift::StreamClientCallback*)':

    RocketClientChannel.cpp:(.text+0x4bd0): undefined reference to `apache::thrift::RequestRpcMetadata::~RequestRpcMetadata()'

    RocketClientChannel.cpp:(.text+0x4c3f): undefined reference to `apache::thrift::RequestRpcMetadata::~RequestRpcMetadata()'

    /home/travis/build/facebook/mcrouter/mcrouter-install/install/lib/libthriftcpp2.a(RocketClientChannel.cpp.o): In function `apache::thrift::RocketClientChannel::sendRequestSink(apache::thrift::RpcOptions const&, folly::Range<char const*>, apache::thrift::SerializedRequest&&, std::shared_ptr<apache::thrift::transport::THeader>, apache::thrift::SinkClientCallback*)':

    RocketClientChannel.cpp:(.text+0x4f4f): undefined reference to `apache::thrift::RequestRpcMetadata::~RequestRpcMetadata()'

    RocketClientChannel.cpp:(.text+0x4fd9): undefined reference to `apache::thrift::RequestRpcMetadata::~RequestRpcMetadata()'

    /home/travis/build/facebook/mcrouter/mcrouter-install/install/lib/libthriftcpp2.a(RocketClientChannel.cpp.o): In function `apache::thrift::RocketClientChannel::sendThriftRequest(apache::thrift::RpcOptions const&, apache::thrift::RpcKind, folly::Range<char const*>, apache::thrift::SerializedRequest&&, std::shared_ptr<apache::thrift::transport::THeader>, std::unique_ptr<apache::thrift::RequestClientCallback, apache::thrift::RequestClientCallback::RequestClientCallbackDeleter>)':

    RocketClientChannel.cpp:(.text+0x539a): undefined reference to `apache::thrift::RequestRpcMetadata::~RequestRpcMetadata()'

    /home/travis/build/facebook/mcrouter/mcrouter-install/install/lib/libthriftcpp2.a(RocketClientChannel.cpp.o):RocketClientChannel.cpp:(.text+0x5452): more undefined references to `apache::thrift::RequestRpcMetadata::~RequestRpcMetadata()' follow

    /home/travis/build/facebook/mcrouter/mcrouter-install/install/lib/libthriftcpp2.a(RocketClientChannel.cpp.o): In function `apache::thrift::CodecConfig::~CodecConfig()':

    RocketClientChannel.cpp:(.text._ZN6apache6thrift11CodecConfigD2 (https://github.com/facebook/mcrouter/commit/17023c87c2fbd9db4b0870e03df77e7928777165)Ev[_ZN6apache6thrift11CodecConfigD5 (https://github.com/facebook/mcrouter/commit/8cd0925a1cf67b87a3ded0747a5b6d6976f94ccf)Ev]+0x14): undefined reference to `apache::thrift::CodecConfig::__clear()'

    /home/travis/build/facebook/mcrouter/mcrouter-install/install/lib/libthriftcpp2.a(RocketClientChannel.cpp.o): In function `apache::thrift::CodecConfig::set_zlibConfig(apache::thrift::ZlibCompressionCodecConfig const&)':

    RocketClientChannel.cpp:(.text._ZN6apache6thrift11CodecConfig14set_zlibConfigERKNS0_26ZlibCompressionCodecConfigE[_ZN6apache6thrift11CodecConfig14set_zlibConfigERKNS0_26ZlibCompressionCodecConfigE]+0x18): undefined reference to `apache::thrift::CodecConfig::__clear()'

    /home/travis/build/facebook/mcrouter/mcrouter-install/install/lib/libthriftcpp2.a(RocketClientChannel.cpp.o): In function `apache::thrift::CodecConfig::set_zstdConfig(apache::thrift::ZstdCompressionCodecConfig const&)':

    RocketClientChannel.cpp:(.text._ZN6apache6thrift11CodecConfig14set_zstdConfigERKNS0_26ZstdCompressionCodecConfigE[_ZN6apache6thrift11CodecConfig14set_zstdConfigERKNS0_26ZstdCompressionCodecConfigE]+0x18): undefined reference to `apache::thrift::CodecConfig::__clear()'

    /home/travis/build/facebook/mcrouter/mcrouter-install/install/lib/libthriftcpp2.a(RocketClientChannel.cpp.o): In function `apache::thrift::PayloadExceptionMetadata::PayloadExceptionMetadata(apache::thrift::PayloadExceptionMetadata&&)':

    RocketClientChannel.cpp:(.text._ZN6apache6thrift24PayloadExceptionMetadataC2EOS1_[_ZN6apache6thrift24PayloadExceptionMetadataC5EOS1_]+0x15a): undefined reference to `apache::thrift::PayloadExceptionMetadata::__clear()'

    /home/travis/build/facebook/mcrouter/mcrouter-install/install/lib/libthriftcpp2.a(RocketClientChannel.cpp.o): In function `apache::thrift::PayloadExceptionMetadata::set_declaredException(apache::thrift::PayloadDeclaredExceptionMetadata&&)':

    RocketClientChannel.cpp:(.text._ZN6apache6thrift24PayloadExceptionMetadata21set_declaredExceptionEONS0_32PayloadDeclaredExceptionMetadataE[_ZN6apache6thrift24PayloadExceptionMetadata21set_declaredExceptionEONS0_32PayloadDeclaredExceptionMetadataE]+0x18): undefined reference to `apache::thrift::PayloadExceptionMetadata::__clear()'

    /home/travis/build/facebook/mcrouter/mcrouter-install/install/lib/libthriftcpp2.a(RocketClientChannel.cpp.o): In function `apache::thrift::PayloadExceptionMetadata::set_proxyException(apache::thrift::PayloadProxyExceptionMetadata&&)':

    RocketClientChannel.cpp:(.text._ZN6apache6thrift24PayloadExceptionMetadata18set_proxyExceptionEONS0_29PayloadProxyExceptionMetadataE[_ZN6apache6thrift24PayloadExceptionMetadata18set_proxyExceptionEONS0_29PayloadProxyExceptionMetadataE]+0x18): undefined reference to `apache::thrift::PayloadExceptionMetadata::__clear()'

    /home/travis/build/facebook/mcrouter/mcrouter-install/install/lib/libthriftcpp2.a(RocketClientChannel.cpp.o): In function `apache::thrift::PayloadExceptionMetadata::set_proxiedException(apache::thrift::PayloadProxiedExceptionMetadata&&)':

    RocketClientChannel.cpp:(.text._ZN6apache6thrift24PayloadExceptionMetadata20set_proxiedExceptionEONS0_31PayloadProxiedExceptionMetadataE[_ZN6apache6thrift24PayloadExceptionMetadata20set_proxiedExceptionEONS0_31PayloadProxiedExceptionMetadataE]+0x18): undefined reference to `apache::thrift::PayloadExceptionMetadata::__clear()'

    /home/travis/build/facebook/mcrouter/mcrouter-install/install/lib/libthriftcpp2.a(RocketClientChannel.cpp.o): In function `apache::thrift::PayloadExceptionMetadata::set_appClientException(apache::thrift::PayloadAppClientExceptionMetadata&&)':

    RocketClientChannel.cpp:(.text._ZN6apache6thrift24PayloadExceptionMetadata22set_appClientExceptionEONS0_33PayloadAppClientExceptionMetadataE[_ZN6apache6thrift24PayloadExceptionMetadata22set_appClientExceptionEONS0_33PayloadAppClientExceptionMetadataE]+0x18): undefined reference to `apache::thrift::PayloadExceptionMetadata::__clear()'

    /home/travis/build/facebook/mcrouter/mcrouter-install/install/lib/libthriftcpp2.a(RocketClientChannel.cpp.o):RocketClientChannel.cpp:(.text._ZN6apache6thrift24PayloadExceptionMetadata22set_appServerExceptionEONS0_33PayloadAppServerExceptionMetadataE[_ZN6apache6thrift24PayloadExceptionMetadata22set_appServerExceptionEONS0_33PayloadAppServerExceptionMetadataE]+0x18): more undefined references to `apache::thrift::PayloadExceptionMetadata::__clear()' follow

    /home/travis/build/facebook/mcrouter/mcrouter-install/install/lib/libthriftcpp2.a(RocketClientChannel.cpp.o): In function `apache::thrift::PayloadMetadata::PayloadMetadata(apache::thrift::PayloadMetadata&&)':

    RocketClientChannel.cpp:(.text._ZN6apache6thrift15PayloadMetadataC2EOS1_[_ZN6apache6thrift15PayloadMetadataC5EOS1_]+0xc8): undefined reference to `apache::thrift::PayloadMetadata::__clear()'

    /home/travis/build/facebook/mcrouter/mcrouter-install/install/lib/libthriftcpp2.a(RocketClientChannel.cpp.o): In function `apache::thrift::PayloadMetadata::set_responseMetadata(apache::thrift::PayloadResponseMetadata&&)':

    RocketClientChannel.cpp:(.text._ZN6apache6thrift15PayloadMetadata20set_responseMetadataEONS0_23PayloadResponseMetadataE[_ZN6apache6thrift15PayloadMetadata20set_responseMetadataEONS0_23PayloadResponseMetadataE]+0x18): undefined reference to `apache::thrift::PayloadMetadata::__clear()'

    /home/travis/build/facebook/mcrouter/mcrouter-install/install/lib/libthriftcpp2.a(RocketClientChannel.cpp.o): In function `apache::thrift::PayloadMetadata::set_exceptionMetadata(apache::thrift::PayloadExceptionMetadataBase&&)':

    RocketClientChannel.cpp:(.text._ZN6apache6thrift15PayloadMetadata21set_exceptionMetadataEONS0_28PayloadExceptionMetadataBaseE[_ZN6apache6thrift15PayloadMetadata21set_exceptionMetadataEONS0_28PayloadExceptionMetadataBaseE]+0x1d): undefined reference to `apache::thrift::PayloadMetadata::__clear()'

    /home/travis/build/facebook/mcrouter/mcrouter-install/install/lib/libthriftcpp2.a(RocketClientChannel.cpp.o): In function `apache::thrift::FirstResponsePayload::~FirstResponsePayload()':

    RocketClientChannel.cpp:(.text._ZN6apache6thrift20FirstResponsePayloadD2 (https://github.com/facebook/mcrouter/commit/17023c87c2fbd9db4b0870e03df77e7928777165)Ev[_ZN6apache6thrift20FirstResponsePayloadD5 (https://github.com/facebook/mcrouter/commit/8cd0925a1cf67b87a3ded0747a5b6d6976f94ccf)Ev]+0x18): undefined reference to `apache::thrift::ResponseRpcMetadata::~ResponseRpcMetadata()'

    /home/travis/build/facebook/mcrouter/mcrouter-install/install/lib/libthriftcpp2.a(RocketClientChannel.cpp.o): In function `apache::thrift::rocket::unpack<apache::thrift::FirstResponsePayload>(apache::thrift::rocket::Payload&&)::{lambda()https://github.com/facebook/mcrouter/issues/1}::operator()() const':

    RocketClientChannel.cpp:(.text._ZZN6apache6thrift6rocket6unpackINS0_20FirstResponsePayloadEEEN5folly3TryIT_EEONS1_7PayloadEENKUlvE_clEv[_ZZN6apache6thrift6rocket6unpackINS0_20FirstResponsePayloadEEEN5folly3TryIT_EEONS1_7PayloadEENKUlvE_clEv]+0x43): undefined reference to `apache::thrift::ResponseRpcMetadata::ResponseRpcMetadata()'

    RocketClientChannel.cpp:(.text._ZZN6apache6thrift6rocket6unpackINS0_20FirstResponsePayloadEEEN5folly3TryIT_EEONS1_7PayloadEENKUlvE_clEv[_ZZN6apache6thrift6rocket6unpackINS0_20FirstResponsePayloadEEEN5folly3TryIT_EEONS1_7PayloadEENKUlvE_clEv]+0x72): undefined reference to `apache::thrift::ResponseRpcMetadata::~ResponseRpcMetadata()'

    RocketClientChannel.cpp:(.text._ZZN6apache6thrift6rocket6unpackINS0_20FirstResponsePayloadEEEN5folly3TryIT_EEONS1_7PayloadEENKUlvE_clEv[_ZZN6apache6thrift6rocket6unpackINS0_20FirstResponsePayloadEEEN5folly3TryIT_EEONS1_7PayloadEENKUlvE_clEv]+0x434): undefined reference to `apache::thrift::ResponseRpcMetadata::~ResponseRpcMetadata()'

    /home/travis/build/facebook/mcrouter/mcrouter-install/install/lib/libthriftcpp2.a(RocketClientChannel.cpp.o): In function `unsigned int apache::thrift::ResponseRpcError::read<apache::thrift::CompactProtocolReader>(apache::thrift::CompactProtocolReader*)':

    RocketClientChannel.cpp:(.text._ZN6apache6thrift16ResponseRpcError4readINS0_21CompactProtocolReaderEEEjPT_[_ZN6apache6thrift16ResponseRpcError4readINS0_21CompactProtocolReaderEEEjPT_]+0x2f): undefined reference to `void apache::thrift::ResponseRpcError::readNoXfer<apache::thrift::CompactProtocolReader>(apache::thrift::CompactProtocolReader*)'

    /home/travis/build/facebook/mcrouter/mcrouter-install/install/lib/libthriftcpp2.a(RocketClientChannel.cpp.o): In function `unsigned int apache::thrift::ResponseRpcMetadata::read<apache::thrift::CompactProtocolReader>(apache::thrift::CompactProtocolReader*)':

    RocketClientChannel.cpp:(.text._ZN6apache6thrift19ResponseRpcMetadata4readINS0_21CompactProtocolReaderEEEjPT_[_ZN6apache6thrift19ResponseRpcMetadata4readINS0_21CompactProtocolReaderEEEjPT_]+0x2f): undefined reference to `void apache::thrift::ResponseRpcMetadata::readNoXfer<apache::thrift::CompactProtocolReader>(apache::thrift::CompactProtocolReader*)'

    /home/travis/build/facebook/mcrouter/mcrouter-install/install/lib/libthriftcpp2.a(RpcMetadataUtil.cpp.o): In function `apache::thrift::detail::makeRequestRpcMetadata(apache::thrift::RpcOptions const&, apache::thrift::RpcKind, apache::thrift::ProtocolId, folly::Range<char const*>, std::chrono::duration<long, std::ratio<1l, 1000l> >, apache::thrift::transport::THeader&, std::map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > > const&)':

    RpcMetadataUtil.cpp:(.text+0x64): undefined reference to `apache::thrift::RequestRpcMetadata::RequestRpcMetadata()'

    RpcMetadataUtil.cpp:(.text+0xbe6): undefined reference to `apache::thrift::RequestRpcMetadata::~RequestRpcMetadata()'

    /home/travis/build/facebook/mcrouter/mcrouter-install/install/lib/libthriftcpp2.a(RpcMetadataUtil.cpp.o): In function `apache::thrift::CodecConfig::operator=(apache::thrift::CodecConfig const&)':

    RpcMetadataUtil.cpp:(.text._ZN6apache6thrift11CodecConfigaSERKS1_[_ZN6apache6thrift11CodecConfigaSERKS1_]+0x2b): undefined reference to `apache::thrift::CodecConfig::__clear()'

    /home/travis/build/facebook/mcrouter/mcrouter-install/install/lib/libthriftcpp2.a(PayloadUtils.cpp.o): In function `apache::thrift::rocket::Payload apache::thrift::rocket::detail::makePayload<apache::thrift::RequestRpcMetadata>(apache::thrift::RequestRpcMetadata const&, std::unique_ptr<folly::IOBuf, std::default_delete<folly::IOBuf> >)':

    PayloadUtils.cpp:(.text._ZN6apache6thrift6rocket6detail11makePayloadINS0_18RequestRpcMetadataEEENS1_7PayloadERKT_St10unique_ptrIN5folly5IOBufESt14default_deleteISB_EE[_ZN6apache6thrift6rocket6detail11makePayloadINS0_18RequestRpcMetadataEEENS1_7PayloadERKT_St10unique_ptrIN5folly5IOBufESt14default_deleteISB_EE]+0x5b): undefined reference to `unsigned int apache::thrift::RequestRpcMetadata::serializedSizeZC<apache::thrift::CompactProtocolWriter>(apache::thrift::CompactProtocolWriter const*) const'

    PayloadUtils.cpp:(.text._ZN6apache6thrift6rocket6detail11makePayloadINS0_18RequestRpcMetadataEEENS1_7PayloadERKT_St10unique_ptrIN5folly5IOBufESt14default_deleteISB_EE[_ZN6apache6thrift6rocket6detail11makePayloadINS0_18RequestRpcMetadataEEENS1_7PayloadERKT_St10unique_ptrIN5folly5IOBufESt14default_deleteISB_EE]+0x236): undefined reference to `unsigned int apache::thrift::RequestRpcMetadata::write<apache::thrift::CompactProtocolWriter>(apache::thrift::CompactProtocolWriter*) const'

    PayloadUtils.cpp:(.text._ZN6apache6thrift6rocket6detail11makePayloadINS0_18RequestRpcMetadataEEENS1_7PayloadERKT_St10unique_ptrIN5folly5IOBufESt14default_deleteISB_EE[_ZN6apache6thrift6rocket6detail11makePayloadINS0_18RequestRpcMetadataEEENS1_7PayloadERKT_St10unique_ptrIN5folly5IOBufESt14default_deleteISB_EE]+0x406): undefined reference to `unsigned int apache::thrift::RequestRpcMetadata::write<apache::thrift::CompactProtocolWriter>(apache::thrift::CompactProtocolWriter*) const'

    /home/travis/build/facebook/mcrouter/mcrouter-install/install/lib/libthriftcpp2.a(PayloadUtils.cpp.o): In function `apache::thrift::rocket::Payload apache::thrift::rocket::detail::makePayload<apache::thrift::ResponseRpcMetadata>(apache::thrift::ResponseRpcMetadata const&, std::unique_ptr<folly::IOBuf, std::default_delete<folly::IOBuf> >)':

    PayloadUtils.cpp:(.text._ZN6apache6thrift6rocket6detail11makePayloadINS0_19ResponseRpcMetadataEEENS1_7PayloadERKT_St10unique_ptrIN5folly5IOBufESt14default_deleteISB_EE[_ZN6apache6thrift6rocket6detail11makePayloadINS0_19ResponseRpcMetadataEEENS1_7PayloadERKT_St10unique_ptrIN5folly5IOBufESt14default_deleteISB_EE]+0x5b): undefined reference to `unsigned int apache::thrift::ResponseRpcMetadata::serializedSizeZC<apache::thrift::CompactProtocolWriter>(apache::thrift::CompactProtocolWriter const*) const'

    PayloadUtils.cpp:(.text._ZN6apache6thrift6rocket6detail11makePayloadINS0_19ResponseRpcMetadataEEENS1_7PayloadERKT_St10unique_ptrIN5folly5IOBufESt14default_deleteISB_EE[_ZN6apache6thrift6rocket6detail11makePayloadINS0_19ResponseRpcMetadataEEENS1_7PayloadERKT_St10unique_ptrIN5folly5IOBufESt14default_deleteISB_EE]+0x236): undefined reference to `unsigned int apache::thrift::ResponseRpcMetadata::write<apache::thrift::CompactProtocolWriter>(apache::thrift::CompactProtocolWriter*) const'

    PayloadUtils.cpp:(.text._ZN6apache6thrift6rocket6detail11makePayloadINS0_19ResponseRpcMetadataEEENS1_7PayloadERKT_St10unique_ptrIN5folly5IOBufESt14default_deleteISB_EE[_ZN6apache6thrift6rocket6detail11makePayloadINS0_19ResponseRpcMetadataEEENS1_7PayloadERKT_St10unique_ptrIN5folly5IOBufESt14default_deleteISB_EE]+0x406): undefined reference to `unsigned int apache::thrift::ResponseRpcMetadata::write<apache::thrift::CompactProtocolWriter>(apache::thrift::CompactProtocolWriter*) const'

    /home/travis/build/facebook/mcrouter/mcrouter-install/install/lib/libthriftcpp2.a(PayloadUtils.cpp.o): In function `apache::thrift::rocket::Payload apache::thrift::rocket::detail::makePayload<apache::thrift::StreamPayloadMetadata>(apache::thrift::StreamPayloadMetadata const&, std::unique_ptr<folly::IOBuf, std::default_delete<folly::IOBuf> >)':

    PayloadUtils.cpp:(.text._ZN6apache6thrift6rocket6detail11makePayloadINS0_21StreamPayloadMetadataEEENS1_7PayloadERKT_St10unique_ptrIN5folly5IOBufESt14default_deleteISB_EE[_ZN6apache6thrift6rocket6detail11makePayloadINS0_21StreamPayloadMetadataEEENS1_7PayloadERKT_St10unique_ptrIN5folly5IOBufESt14default_deleteISB_EE]+0x5b): undefined reference to `unsigned int apache::thrift::StreamPayloadMetadata::serializedSizeZC<apache::thrift::CompactProtocolWriter>(apache::thrift::CompactProtocolWriter const*) const'

    PayloadUtils.cpp:(.text._ZN6apache6thrift6rocket6detail11makePayloadINS0_21StreamPayloadMetadataEEENS1_7PayloadERKT_St10unique_ptrIN5folly5IOBufESt14default_deleteISB_EE[_ZN6apache6thrift6rocket6detail11makePayloadINS0_21StreamPayloadMetadataEEENS1_7PayloadERKT_St10unique_ptrIN5folly5IOBufESt14default_deleteISB_EE]+0x236): undefined reference to `unsigned int apache::thrift::StreamPayloadMetadata::write<apache::thrift::CompactProtocolWriter>(apache::thrift::CompactProtocolWriter*) const'

    PayloadUtils.cpp:(.text._ZN6apache6thrift6rocket6detail11makePayloadINS0_21StreamPayloadMetadataEEENS1_7PayloadERKT_St10unique_ptrIN5folly5IOBufESt14default_deleteISB_EE[_ZN6apache6thrift6rocket6detail11makePayloadINS0_21StreamPayloadMetadataEEENS1_7PayloadERKT_St10unique_ptrIN5folly5IOBufESt14default_deleteISB_EE]+0x406): undefined reference to `unsigned int apache::thrift::StreamPayloadMetadata::write<apache::thrift::CompactProtocolWriter>(apache::thrift::CompactProtocolWriter*) const'

    /home/travis/build/facebook/mcrouter/mcrouter-install/install/lib/libthriftcpp2.a(PayloadUtils.cpp.o): In function `apache::thrift::rocket::Payload apache::thrift::rocket::detail::makePayload<apache::thrift::HeadersPayloadMetadata>(apache::thrift::HeadersPayloadMetadata const&, std::unique_ptr<folly::IOBuf, std::default_delete<folly::IOBuf> >)':

    PayloadUtils.cpp:(.text._ZN6apache6thrift6rocket6detail11makePayloadINS0_22HeadersPayloadMetadataEEENS1_7PayloadERKT_St10unique_ptrIN5folly5IOBufESt14default_deleteISB_EE[_ZN6apache6thrift6rocket6detail11makePayloadINS0_22HeadersPayloadMetadataEEENS1_7PayloadERKT_St10unique_ptrIN5folly5IOBufESt14default_deleteISB_EE]+0x5b): undefined reference to `unsigned int apache::thrift::HeadersPayloadMetadata::serializedSizeZC<apache::thrift::CompactProtocolWriter>(apache::thrift::CompactProtocolWriter const*) const'

    PayloadUtils.cpp:(.text._ZN6apache6thrift6rocket6detail11makePayloadINS0_22HeadersPayloadMetadataEEENS1_7PayloadERKT_St10unique_ptrIN5folly5IOBufESt14default_deleteISB_EE[_ZN6apache6thrift6rocket6detail11makePayloadINS0_22HeadersPayloadMetadataEEENS1_7PayloadERKT_St10unique_ptrIN5folly5IOBufESt14default_deleteISB_EE]+0x236): undefined reference to `unsigned int apache::thrift::HeadersPayloadMetadata::write<apache::thrift::CompactProtocolWriter>(apache::thrift::CompactProtocolWriter*) const'

    PayloadUtils.cpp:(.text._ZN6apache6thrift6rocket6detail11makePayloadINS0_22HeadersPayloadMetadataEEENS1_7PayloadERKT_St10unique_ptrIN5folly5IOBufESt14default_deleteISB_EE[_ZN6apache6thrift6rocket6detail11makePayloadINS0_22HeadersPayloadMetadataEEENS1_7PayloadERKT_St10unique_ptrIN5folly5IOBufESt14default_deleteISB_EE]+0x406): undefined reference to `unsigned int apache::thrift::HeadersPayloadMetadata::write<apache::thrift::CompactProtocolWriter>(apache::thrift::CompactProtocolWriter*) const'

    /home/travis/build/facebook/mcrouter/mcrouter-install/install/lib/libthriftcpp2.a(RocketClient.cpp.o): In function `std::unique_ptr<folly::IOBuf, std::default_delete<folly::IOBuf> > apache::thrift::rocket::packCompact<apache::thrift::InteractionTerminate>(apache::thrift::InteractionTerminate&&)':

    RocketClient.cpp:(.text._ZN6apache6thrift6rocket11packCompactINS0_20InteractionTerminateEEESt10unique_ptrIN5folly5IOBufESt14default_deleteIS6_EEOT_[_ZN6apache6thrift6rocket11packCompactINS0_20InteractionTerminateEEESt10unique_ptrIN5folly5IOBufESt14default_deleteIS6_EEOT_]+0x9b): undefined reference to `unsigned int apache::thrift::InteractionTerminate::write<apache::thrift::CompactProtocolWriter>(apache::thrift::CompactProtocolWriter*) const'

    /home/travis/build/facebook/mcrouter/mcrouter-install/install/lib/libthriftcpp2.a(RocketClient.cpp.o): In function `std::unique_ptr<folly::IOBuf, std::default_delete<folly::IOBuf> > apache::thrift::rocket::packCompact<apache::thrift::HeadersPayloadContent>(apache::thrift::HeadersPayloadContent&&)':

    RocketClient.cpp:(.text._ZN6apache6thrift6rocket11packCompactINS0_21HeadersPayloadContentEEESt10unique_ptrIN5folly5IOBufESt14default_deleteIS6_EEOT_[_ZN6apache6thrift6rocket11packCompactINS0_21HeadersPayloadContentEEESt10unique_ptrIN5folly5IOBufESt14default_deleteIS6_EEOT_]+0x9b): undefined reference to `unsigned int apache::thrift::HeadersPayloadContent::write<apache::thrift::CompactProtocolWriter>(apache::thrift::CompactProtocolWriter*) const'

    /home/travis/build/facebook/mcrouter/mcrouter-install/install/lib/libthriftcpp2.a(RocketClient.cpp.o): In function `unsigned int apache::thrift::StreamPayloadMetadata::read<apache::thrift::CompactProtocolReader>(apache::thrift::CompactProtocolReader*)':

    RocketClient.cpp:(.text._ZN6apache6thrift21StreamPayloadMetadata4readINS0_21CompactProtocolReaderEEEjPT_[_ZN6apache6thrift21StreamPayloadMetadata4readINS0_21CompactProtocolReaderEEEjPT_]+0x2f): undefined reference to `void apache::thrift::StreamPayloadMetadata::readNoXfer<apache::thrift::CompactProtocolReader>(apache::thrift::CompactProtocolReader*)'

    /home/travis/build/facebook/mcrouter/mcrouter-install/install/lib/libthriftcpp2.a(RocketClient.cpp.o): In function `unsigned int apache::thrift::HeadersPayloadMetadata::read<apache::thrift::CompactProtocolReader>(apache::thrift::CompactProtocolReader*)':

    RocketClient.cpp:(.text._ZN6apache6thrift22HeadersPayloadMetadata4readINS0_21CompactProtocolReaderEEEjPT_[_ZN6apache6thrift22HeadersPayloadMetadata4readINS0_21CompactProtocolReaderEEEjPT_]+0x2f): undefined reference to `void apache::thrift::HeadersPayloadMetadata::readNoXfer<apache::thrift::CompactProtocolReader>(apache::thrift::CompactProtocolReader*)'

    /home/travis/build/facebook/mcrouter/mcrouter-install/install/lib/libthriftcpp2.a(RocketClient.cpp.o): In function `unsigned int apache::thrift::HeadersPayloadContent::read<apache::thrift::CompactProtocolReader>(apache::thrift::CompactProtocolReader*)':

    RocketClient.cpp:(.text._ZN6apache6thrift21HeadersPayloadContent4readINS0_21CompactProtocolReaderEEEjPT_[_ZN6apache6thrift21HeadersPayloadContent4readINS0_21CompactProtocolReaderEEEjPT_]+0x2f): undefined reference to `void apache::thrift::HeadersPayloadContent::readNoXfer<apache::thrift::CompactProtocolReader>(apache::thrift::CompactProtocolReader*)'

    collect2: error: ld returned 1 exit status
    ```
</details>

This change adds `-lrpcmetadata` to `LDADD` where relevant.

Pull Request resolved: #348

Reviewed By: jmswen

Differential Revision: D22908580

Pulled By: stuclar

fbshipit-source-id: 1257901a54ecd9d18a8bde12cc146111e901989f
facebook-github-bot pushed a commit that referenced this issue May 26, 2021
…pp` to speed up build.

Summary:
Same goal and idea as D26886048 (a3d9640) but a different implementation. This diff explicitly instantiates the templates rather than splitting the logic into multiple files.

## `McRouteHandleProvider.cpp`

This file is the #1 entry in [Buck Critical Path Rules](https://fburl.com/scuba/buck_critical_path_rules/edmgxdyj) and #1 in [Buck Slow Targets](https://fburl.com/scuba/buck_slow_targets/f40w9jgc) Scuba tables, having taken about ~294 hours in the critical path of builds on devservers in the past 30 days.

This diff reduces the compile time from roughly 3:19 min to 58 sec, or **~71% less** than before on a devbig.

## `MCMemcache.cpp`

This file is currently the #3 entry in [Buck Critical Path Rules](https://fburl.com/scuba/buck_critical_path_rules/edmgxdyj) and #2 in [Buck Slow Targets](https://fburl.com/scuba/buck_slow_targets/f40w9jgc) Scuba tables, having taken about ~121 hours in the critical path of builds on devservers in the past 30 days.

This diff reduces the compile time from roughly 3:08 to 1:19 min, or **~58% less** than before on a devbig.

## `CarbonLookasideRoute.cpp`

This file is currently #4 in [Buck Slow Targets](https://fburl.com/scuba/buck_slow_targets/f40w9jgc) Scuba tables.

This diff reduces the compile time from roughly 2:45 min to 50 sec, or **~70% less** than before on a devbig.

 ---

## Build speed wins simulator results by antonl

```
mcrouter_wins_week_of_2021-05-25: Would have saved 105.6h over 7.0 days (or 2.86 HC saving) across 4683 builds
```
[Simulation Breakdown](https://www.internalfb.com/intern/everpaste/?color=0&handle=GO-eogkA-VdfCQoCAGiLqBIg76ZzbjEQAAAz)
```
mcrouter_wins_week_of_2021-05-18: Would have saved 111.5h over 7.0 days (or 3.02 HC saving) across 4707 builds
```
[Simulation Breakdown](https://www.internalfb.com/intern/everpaste/?color=0&handle=GCT2bAssgNdTV4wAAFjustfU-MQ2bjEQAAAz)
```
mcrouter_wins_week_of_2021-05-11: Would have saved 114.3h over 7.0 days (or 3.09 HC saving) across 4743 builds
```
[Simulation Breakdown](https://www.internalfb.com/intern/everpaste/?color=0&handle=GMINJwvaK7q4QjcDAIIDLhwE7psybjEQAAAz)
```
mcrouter_wins_week_of_2021-05-04: Would have saved 100.8h over 7.0 days (or 2.73 HC saving) across 4329 builds
```
[Simulation Breakdown](https://www.internalfb.com/intern/everpaste/?color=0&handle=GD2 (39463c269d90173d159cb74b933719415a524956)f6AqcpT1L5gMLAJjpyfVIMFBYbjEQAAAz)

Differential Revision: D28529360

fbshipit-source-id: 06e1cc933063ef2f297740184f3c978fe86e667f
facebook-github-bot pushed a commit that referenced this issue Jun 8, 2021
Summary:
The concept of a `MultiIdentityCertificate` is being phased out (citation needed). It is simply a decoration that allows us to:
- Replace the x509 payload in a peer cert with a list of `Identity` objects, which are an FB-specific concept
- Still refer to certificates (and the transports containing them) generically, enabling them to be OSS.

Hence to get the identities in a connection we simply extract the certificate, cast it to a `MultiIdentityCertiticate`, and get the identities extracted.

This approach is being phased out in favor of a more generic way of extracting peer identities, either by:
1) Direct extraction from the `transport` using the x509 payload of the peer certificate on every request (using `getClientIdentitiesFromTransport`)
2) A `clientIdentityHook` which runs at connection establishment time to populate `Cpp2ConnContext` with a `void*` typed list of identities. These identities are extracted from the transport using the hook, by calling #1. They can then be extracted with `getClientIdentitiesFromCtx`.

This diff removes all instances of `MultiIdentityCertificate` from Mcrouter code, replacing it instead with #1 above. However, this suffers from two drawbacks:
- Higher CPU overhead. As we need to parse the identities on the fast path on every request in gACL
- Higher memory overhead. As we're keeping both the underlying identities and the x509 payload.

Hence in subsequent diffs we will:
1. Move to using only `getClientIdentitiesFromCtx` everywhere, which uses the pre-parsed Identities extracted at connection time (saving CPU)
2. Use `dropPeerCertificate()` on the `Transport` after the client identity hook is executed (saving memory).

We'll avoid landing this diff before doing the above.

Concurrently, we should remove all instances of MultiIdentityCertificate from SR. Discussing this with AjanthanAsogamoorthy.

Reviewed By: stuclar

Differential Revision: D27926976

fbshipit-source-id: 44d8b2a31abd3e685e1956221797ad6f44ac471f
facebook-github-bot pushed a commit that referenced this issue Dec 4, 2024
Summary:
McRouter leaks the client instance if it encounters errors, like config failure, SMC unavailability, etc. This has caused [some issues](https://fb.workplace.com/groups/604299349618684/permalink/27403334835955105/) for us over the past year.

**This diff:** Moving the client instance to the aux thread, so it can be auto-destructed after its SR dependencies are released.

With the [context](https://fb.workplace.com/groups/604299349618684/posts/27403334835955105/?comment_id=27406017052353550&reply_comment_id=27406822342273021) disylh shared, I was curious to see if this approach might work, and what might be the gaps we need to tackle.

I followed the discussion on the [previous attempt](https://www.internalfb.com/diff/D44641566?dst_version_fbid=1590697228110996&transaction_fbid=143930055086555) where this was discussed. Iiuc, #1 is addressed now as we manually do the SR deps release before destruction. I didn't quite follow #2, and why clearing the event base would cause the deadlock (maybe it wouldn't anymore, since we destruct from a different thread). But curious to hear opinions!

Reviewed By: disylh

Differential Revision: D66252318

fbshipit-source-id: 498ea74ab78c6dc0e70b1471a0779551002e27ac
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants