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

BRPC cause pybind embed hang #2559

Open
chenzhengda opened this issue Mar 4, 2024 · 1 comment
Open

BRPC cause pybind embed hang #2559

chenzhengda opened this issue Mar 4, 2024 · 1 comment

Comments

@chenzhengda
Copy link

Describe the bug (描述bug)

When I use brpc and pybind embed simultaneously and import numpy, the program gets stuck. However, it returns to normal once I remove the include for the brpc header file.

To Reproduce (复现方法)

#include <brpc/server.h>
#include <pybind11/embed.h>
#include <iostream>

namespace py = pybind11;

int main() {
    py::scoped_interpreter guard{};

    auto sys = py::module_::import("sys");
    std::cout << "Python version: " << sys.attr("version").cast<std::string>() << std::endl;

    // auto np = py::module_::import("numpy");
    // std::cout << "Numpy version: " << np.attr("__version__").cast<std::string>() << std::endl;

    return 0;
}

Expected behavior (期望行为)

Versions (各种版本)
OS:
Compiler:
brpc:
protobuf:

Additional context/screenshots (更多上下文/截图)

@Huixxi
Copy link
Contributor

Huixxi commented Mar 24, 2024

大概率是用法不对。

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