Giter VIP home page Giter VIP logo

pebble's Issues

服务端-服务端间rpc同步调用报错

例如服务A 有一个接口a,在访问A::a时,会rpc调用服务B上的接口b,使用协程应该怎么写呢?

A::a(const ARequest& request, cxx::function<void(int32_t ret_code, const AResponse& response)>& rsp){
  BRequest b_req;
  BResponse b_resp;
  b_client.b(b_req, &b_resp);
  AResponse a_resp;
  // xxxxxx
  rsp(pebble::kRPC_SUCCESS, a_resp);
}

这样会报错
[(src/server/pebble_server.cpp:714)(ProcessMessage)][ERROR] handle(4294967298) not attach a processor remote(4294967298)
[(src/framework/net_message.cpp:766)(RecvTcpData)][ERROR] recv failed(-1:), netaddr=4294967297

编译缺少libconsistent_hash.a库文件

编译环境:
腾讯云机器
centos7.2
gcc version 4.8.5 20150623 (Red Hat 4.8.5-11) (GCC)

请问能建立一个pebble的交流群吗,出现问题方便及时沟通。谢谢~

编译错误信息:
build64_release/source/rpc/compiler/cpp/src/pebble -r -out build64_release/tutorial/helloworld --gen cpp tutorial/helloworld/helloworld.pebble
cd build64_release/source/rpc;cp ../broadcast/libpebble_broadcast.a .;cp ../../thirdparty/consistent_hash/libconsistent_hash.a .;ar -x libpebble_broadcast.a;ar -x libconsistent_hash.a;ar -x common/libpebble_rpc_common.a;ar -x protocol/libpebble_rpc_protocol.a;ar -x transport/libpebble_rpc_transport.a;ar -x libpebble_rpc.a;ar -rcs libpebble_rpc_s.a *.o;rm *.o;rm libpebble_broadcast.a;rm libconsistent_hash.a
cp: cannot stat '../../thirdparty/consistent_hash/libconsistent_hash.a': No such file or directory
ar: libconsistent_hash.a: No such file or directory
rm: cannot remove 'libconsistent_hash.a': No such file or directory
scons: *** [build64_release/source/rpc/libpebble_rpc_s.a] Error 1
scons: building terminated because of errors.
Blade(error): building failure

编译错误

cd build64_release/source/rpc;cp ../broadcast/libpebble_broadcast.a .;cp ../../thirdparty/consistent_hash/libconsistent_hash.a .;ar -x libpebble_broadcast.a;ar -x libconsistent_hash.a;ar -x common/libpebble_rpc_common.a;ar -x protocol/libpebble_rpc_protocol.a;ar -x transport/libpebble_rpc_transport.a;ar -x libpebble_rpc.a;ar -rcs libpebble_rpc_s.a *.o;rm *.o;rm libpebble_broadcast.a;rm libconsistent_hash.a
build64_release/source/rpc/compiler/cpp/src/pebble -r -out build64_release/tutorial/helloworld --gen cpp tutorial/helloworld/helloworld.pebble
Compiling build64_release/tutorial/broadcast/idl/broadcast_tutorial_BroadcastTrigger.cpp
cp: cannot stat '../../thirdparty/consistent_hash/libconsistent_hash.a': No such file or directory
ar: libconsistent_hash.a: No such file or directory
rm: cannot remove 'libconsistent_hash.a': No such file or directory

缺少库啊,编译错误

关于broadcastMgr 的疑问

我看了项目中的broadcastMgr,是采用的订阅者的模式,服务器采用循环TCP发送的方式,向订阅者发送订阅数据;
那么可否实现,一条数据只向订阅组发送一次,达到所有订阅者都能接收到的方式;类似UDP broadcast一样;如果这种方式实现的话,是否会优于目前的方式?如果没有好处,那么原因是什么呢?

solution to compilation failure under ubuntu 16.04

I failed to compile the project in an ubuntu 16.04 docker following the guideline. The following solution worked for me.

  1. apt-get install libreadline-dev && chmod 775 /root/bin/blade
  2. Edit example/threadpool/BUILD. Change
        '#pthread'
        '//src/common/:pebble_common',

to

        '//src/common/:pebble_common',
        '#pthread'
  1. There are two linkage errors with the provided protobuf libraries. Installing the official version solved the problem.
  • Download it from the official repo and install it following the guideline
  • ldconfig
  • Edit tools/compiler/pb/BUILD. Change
    deps = [
        '//src/common:pebble_common',
        '//thirdparty/protobuf:protoc',
    ]

to

    deps = [
        '#protoc',
        '#protobuf',
        '//src/common:pebble_common',
    ]

Now it compiles.

编译有一个错误

Blade(warning): Auto upgrade failure: /root/bin/blade: line 75: svn: command not found
Blade(warning): Please svn up /mnt/git_project/Pebble/tools/blade
Blade(warning): You can setenv BLADE_AUTO_UPGRADE=no to disable auto upgrade
Blade(info): loading BUILDs...
Blade(info): loading done.
Blade(info): analyzing dependency graph...
Blade(info): analyzing done.
Blade(info): generating build rules...
sh: 1: svn: not found
Blade(info): CPP=cpp
Blade(info): CC=gcc
Blade(info): CXX=g++
Blade(info): NVCC=nvcc
Blade(info): LD=g++
Blade(info): generating done.
Blade(info): tunes the parallel jobs number(-j N) to be 2
scons: Reading SConscript files ...
scons: done reading SConscript files.
scons: Building targets ...
scons: building associated VariantDir targets: build64_release
Updating version information
Compiling source/rpc/compiler/cpp/src/main.cc
Compiling source/rpc/compiler/cpp/src/thrifty.cc
g++: internal compiler error: Killed (program cc1plus)
Please submit a full bug report,
with preprocessed source if appropriate.
See file:///usr/share/doc/gcc-4.8/README.Bugs for instructions.
scons: *** [build64_release/source/rpc/compiler/cpp/src/pebble.objs/main.cc.o] Error 4
thrifty.yy:28:0: warning: "__STDC_LIMIT_MACROS" redefined [enabled by default]
:0:0: note: this is the location of the previous definition
thrifty.yy:29:0: warning: "__STDC_FORMAT_MACROS" redefined [enabled by default]
:0:0: note: this is the location of the previous definition
{standard input}: Assembler messages:
{standard input}:5661: Warning: end of file not at end of a line; newline inserted
{standard input}:6328: Error: unknown pseudo-op: `.lvl5'
{standard input}: Error: open CFI at the end of file; missing .cfi_endproc directive
g++: internal compiler error: Killed (program cc1plus)
Please submit a full bug report,
with preprocessed source if appropriate.
See file:///usr/share/doc/gcc-4.8/README.Bugs for instructions.
scons: *** [build64_release/source/rpc/compiler/cpp/src/pebble.objs/thrifty.cc.o] Error 4
scons: building terminated because of errors.
Blade(error): building failure

请问这个是什么问题

框架使用

看了example下的例子,有几点使用上的疑惑

  1. 我目前熟悉的游戏大致流程如下
                     |<--->serviceA
player<->gateway<--->|<--->serviceB
                     |<--->serviceC
  1. 看了pebble的例子,我所理解的是client可以当做player,server可以当做serviceX,
    我如何实现一个gateway来转发client与serviceX的中间层呢

进程号大于102400时会发生段错误

文件src/common/coroutine.cpp 中定义数组
static stCoRoutineEnv_t* g_arrCoEnvPerThread[102400] = {0};

在函数coroutine_open()中直接使用pid作为下标,有可能导致数组下标越界错误。
虽然进程pid小于102400的概率比较小,但我确实遇到了。

能留个联系方式么

能留个联系方式么,或建个QQ群来讨论pebble, pebble rpc 规则文档都木有上传!!!!我的QQ445267987

编译错误

build64_release/src/common/libpebble_common.a(thread.cpp.o): In function pebble::Thread::Start()': /home/Pebble-master/src/common/thread.cpp:34: undefined reference to pthread_create'

编译报错,请指教

Blade(warning): Auto upgrade failure: 跳过“tools/blade”
svn: E155007: None of the targets are working copies
Blade(warning): Please svn up /home/Test/文档/Pebble-master/tools/blade
Blade(warning): You can setenv BLADE_AUTO_UPGRADE=no to disable auto upgrade
Blade(warning): unknown source client type, NOT svn OR git
Blade(info): loading BUILDs...
Blade(error): //./BUILD not found, exit...

编译出错

cc1plus: error: deps/tsf4g/include: No such file or directory [-Werror=missing-include-dirs]
少了tf4g的库

编译protobuf_rpc时,链接报undefined reference错误

我编译protobuf_rpc时,链接报undefined reference错误,具体如下:
Compiling tools/compiler/pb/src/cpp_plugin.cpp
Linking Program build64_release/tools/compiler/pb/protobuf_rpc
build64_release/tools/compiler/pb/protobuf_rpc.objs/src/cpp_plugin.cpp.o: In function `pebble::ProtoBufPrinter::Print(std::map<std::__cxx11::basic_string<char, std::char_traits, std::allocator >, std::__cxx11::basic_string<char, std::char_traits, std::allocator >, std::less<std::__cxx11::basic_string<char, std::char_traits, std::allocator > >, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits, std::allocator > const, std::__cxx11::basic_string<char, std::char_traits, std::allocator > > > > const&, char const*)':

/home/jeffxie/work/c++/Pebble/tools/compiler/pb/src/cpp_plugin.cpp:112: undefined reference to `google::protobuf::io::Printer::Print(std::map<std::__cxx11::basic_string<char, std::char_traits, std::allocator >, std::__cxx11::basic_string<char, std::char_traits, std::allocator >, std::less<std::__cxx11::basic_string<char, std::char_traits, std::allocator > >, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits, std::allocator > const, std::__cxx11::basic_string<char, std::char_traits, std::allocator > > > > const&, char const*)'

build64_release/tools/compiler/pb/protobuf_rpc.objs/src/cpp_plugin.cpp.o: In function `pebble::ProtoBufPrinter::ProtoBufPrinter(std::__cxx11::basic_string<char, std::char_traits, std::allocator >*)':

/home/jeffxie/work/c++/Pebble/tools/compiler/pb/src/cpp_plugin.cpp:109: undefined reference to `google::protobuf::io::StringOutputStream::StringOutputStream(std::__cxx11::basic_string<char, std::char_traits, std::allocator >*)'

collect2: error: ld returned 1 exit status
scons: *** [build64_release/tools/compiler/pb/protobuf_rpc] Error 1
scons: building terminated because of errors.
Blade(error): building failure

是不是thirdparty/protobuf/lib64_release没有提供最新的库导致?请大神们指点!谢谢!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.