Skip to content

Commit

Permalink
Fix python client connecting to server slowly. (#1209)
Browse files Browse the repository at this point in the history
### What problem does this PR solve?

As title

### Type of change

- [x] Bug Fix (non-breaking change which fixes an issue)

Signed-off-by: Jin Hai <[email protected]>
  • Loading branch information
JinHai-CN authored May 15, 2024
1 parent 25e14ce commit cb1656c
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions src/network/thrift_server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -94,14 +94,6 @@ class InfinityServiceCloneFactory final : public infinity_thrift_rpc::InfinitySe
~InfinityServiceCloneFactory() final = default;

infinity_thrift_rpc::InfinityServiceIf *getHandler(const ::apache::thrift::TConnectionInfo &connInfo) final {
SharedPtr<TSocket> sock = std::dynamic_pointer_cast<TSocket>(connInfo.transport);

LOG_TRACE(fmt::format("Incoming connection, SocketInfo: {}, PeerHost: {}, PeerAddress: {}, PeerPort: {}",
sock->getSocketInfo(),
sock->getPeerHost(),
sock->getPeerAddress(),
sock->getPeerPort()));

return new InfinityThriftService;
}

Expand All @@ -118,7 +110,7 @@ void ThreadedThriftServer::Init(i32 port_no) {
server = MakeUnique<TThreadedServer>(MakeShared<infinity_thrift_rpc::InfinityServiceProcessorFactory>(MakeShared<InfinityServiceCloneFactory>()),
MakeShared<TServerSocket>(port_no), // port
MakeShared<TBufferedTransportFactory>(),
binary_protocol_factory);
binary_protocol_factory);
}

void ThreadedThriftServer::Start() { server->serve(); }
Expand Down

0 comments on commit cb1656c

Please sign in to comment.