[jira] [Closed] (THRIFT-5612) C++ v0.16.0 compiles on my ryzen linux box, but getting errors linking on intel mac

2022-08-16 Thread Erik (Jira)


 [ 
https://issues.apache.org/jira/browse/THRIFT-5612?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Erik closed THRIFT-5612.

Resolution: Resolved

forgot to add this in the macbook air


{code:java}
conan profile update settings.compiler.libcxx=libstdc++11 default

{code}

> C++ v0.16.0 compiles on my ryzen linux box, but getting errors linking on 
> intel mac
> ---
>
> Key: THRIFT-5612
> URL: https://issues.apache.org/jira/browse/THRIFT-5612
> Project: Thrift
>  Issue Type: Bug
>  Components: C++ - Library
>Affects Versions: 0.16.0
>Reporter: Erik
>Priority: Minor
>
> I successfully compile my project on a ryzen based linux box (Kubuntu 22.04) 
> ...
> but the same kubuntu on a macbook air is failing to compile around the thrift 
> library.. any ideas?
> {code:java}
> /usr/bin/ld: CMakeFiles/ibrokers_server.dir/src/gen-cpp/ibrokers.cpp.o: in 
> function `twsapithrift::ibrokersConcurrentClient::recv_ping(int)': 
> ibrokers.cpp:(.text+0x4828): undefined reference to 
> `apache::thrift::async::TConcurrentClientSyncInfo::updatePending(std::__cxx11::basic_string  std::char_traits, std::allocator > cons
> t&, apache::thrift::protocol::TMessageType, int)' 
> /usr/bin/ld: ibrokers.cpp:(.text+0x4846): undefined reference to 
> `apache::thrift::async::TConcurrentClientSyncInfo::getPending(std::__cxx11::basic_string  std::char_traits, std::allocator ar> >&, apache::thrift::protocol::TMessageType&, int&)' 
> /usr/bin/ld: CMakeFiles/ibrokers_server.dir/src/gen-cpp/ibrokers.cpp.o: in 
> function 
> `twsapithrift::ibrokersConcurrentClient::recv_ib_status(std::vector  std::char_traits
> , std::allocator >, 
> std::allocator, 
> std::allocator > > >&, int)': 
> ibrokers.cpp:(.text+0x6bd8): undefined reference to 
> `apache::thrift::async::TConcurrentClientSyncInfo::updatePending(std::__cxx11::basic_string  std::char_traits, std::allocator > cons
> t&, apache::thrift::protocol::TMessageType, int)' 
> /usr/bin/ld: ibrokers.cpp:(.text+0x6bf6): undefined reference to 
> `apache::thrift::async::TConcurrentClientSyncInfo::getPending(std::__cxx11::basic_string  std::char_traits, std::allocator ar> >&, apache::thrift::protocol::TMessageType&, int&)' 
> /usr/bin/ld: CMakeFiles/ibrokers_server.dir/src/gen-cpp/ibrokers.cpp.o: in 
> function 
> `twsapithrift::ibrokersConcurrentClient::recv_request_news(std::vector  std::allocator apithrift::NewsResponse> >&, int)': 
> ibrokers.cpp:(.text+0x9be8): undefined reference to 
> `apache::thrift::async::TConcurrentClientSyncInfo::updatePending(std::__cxx11::basic_string  std::char_traits, std::allocator > cons
> t&, apache::thrift::protocol::TMessageType, int)' 
> /usr/bin/ld: ibrokers.cpp:(.text+0x9c06): undefined reference to 
> `apache::thrift::async::TConcurrentClientSyncInfo::getPending(std::__cxx11::basic_string  std::char_traits, std::allocator ar> >&, apache::thrift::protocol::TMessageType&, int&)' 
> /usr/bin/ld: CMakeFiles/ibrokers_server.dir/src/gen-cpp/ibrokers.cpp.o: in 
> function 
> `twsapithrift::ibrokersConcurrentClient::recv_request_historical(std::vector  std::a
> llocator >&, int)': 
> ibrokers.cpp:(.text+0xae18): undefined reference to 
> `apache::thrift::async::TConcurrentClientSyncInfo::updatePending(std::__cxx11::basic_string  std::char_traits, std::allocator > cons
> t&, apache::thrift::protocol::TMessageType, int)' 
> /usr/bin/ld: ibrokers.cpp:(.text+0xae36): undefined reference to 
> `apache::thrift::async::TConcurrentClientSyncInfo::getPending(std::__cxx11::basic_string  std::char_traits, std::allocator ar> >&, apache::thrift::protocol::TMessageType&, int&)' 
> /usr/bin/ld: CMakeFiles/ibrokers_server.dir/src/gen-cpp/ibrokers.cpp.o: in 
> function 
> `twsapithrift::ibrokersConcurrentClient::recv_request_matching_symbols(std::vector se, std::allocator >&, int)': 
> ibrokers.cpp:(.text+0xc048): undefined reference to 
> `apache::thrift::async::TConcurrentClientSyncInfo::updatePending(std::__cxx11::basic_string  std::char_traits, std::allocator > cons
> t&, apache::thrift::protocol::TMessageType, int)' 
> /usr/bin/ld: ibrokers.cpp:(.text+0xc066): undefined reference to 
> `apache::thrift::async::TConcurrentClientSyncInfo::getPending(std::__cxx11::basic_string  std::char_traits, std::allocator ar> >&, apache::thrift::protocol::TMessageType&, int&)' 
> collect2: error: ld returned 1 exit status 
> gmake[2]: *** [CMakeFiles/ibrokers_server.dir/build.make:247: 
> bin/ibrokers_server] Error 1 
> gmake[1]: *** [CMakeFiles/Makefile2:83: CMakeFiles/ibrokers_server.dir/all] 
> Error 2 
> gmake: *** [Makefile:91: all] Error 2 
> chmod: cannot access 'ibrokers_server': No such file or directory
> {code}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Created] (THRIFT-5612) C++ v0.16.0 compiles on my ryzen linux box, but getting errors linking on intel mac

2022-08-16 Thread Erik (Jira)
Erik created THRIFT-5612:


 Summary: C++ v0.16.0 compiles on my ryzen linux box, but getting 
errors linking on intel mac
 Key: THRIFT-5612
 URL: https://issues.apache.org/jira/browse/THRIFT-5612
 Project: Thrift
  Issue Type: Bug
  Components: C++ - Library
Affects Versions: 0.16.0
Reporter: Erik


I successfully compile my project on a ryzen based linux box (Kubuntu 22.04) ...

but the same kubuntu on a macbook air is failing to compile around the thrift 
library.. any ideas?
{code:java}

/usr/bin/ld: CMakeFiles/ibrokers_server.dir/src/gen-cpp/ibrokers.cpp.o: in 
function `twsapithrift::ibrokersConcurrentClient::recv_ping(int)': 
ibrokers.cpp:(.text+0x4828): undefined reference to 
`apache::thrift::async::TConcurrentClientSyncInfo::updatePending(std::__cxx11::basic_string, std::allocator > cons
t&, apache::thrift::protocol::TMessageType, int)' 
/usr/bin/ld: ibrokers.cpp:(.text+0x4846): undefined reference to 
`apache::thrift::async::TConcurrentClientSyncInfo::getPending(std::__cxx11::basic_string, std::allocator >&, apache::thrift::protocol::TMessageType&, int&)' 
/usr/bin/ld: CMakeFiles/ibrokers_server.dir/src/gen-cpp/ibrokers.cpp.o: in 
function 
`twsapithrift::ibrokersConcurrentClient::recv_ib_status(std::vector, std::allocator >, std::allocator, std::allocator > > >&, int)': 
ibrokers.cpp:(.text+0x6bd8): undefined reference to 
`apache::thrift::async::TConcurrentClientSyncInfo::updatePending(std::__cxx11::basic_string, std::allocator > cons
t&, apache::thrift::protocol::TMessageType, int)' 
/usr/bin/ld: ibrokers.cpp:(.text+0x6bf6): undefined reference to 
`apache::thrift::async::TConcurrentClientSyncInfo::getPending(std::__cxx11::basic_string, std::allocator >&, apache::thrift::protocol::TMessageType&, int&)' 
/usr/bin/ld: CMakeFiles/ibrokers_server.dir/src/gen-cpp/ibrokers.cpp.o: in 
function 
`twsapithrift::ibrokersConcurrentClient::recv_request_news(std::vector >&, int)': 
ibrokers.cpp:(.text+0x9be8): undefined reference to 
`apache::thrift::async::TConcurrentClientSyncInfo::updatePending(std::__cxx11::basic_string, std::allocator > cons
t&, apache::thrift::protocol::TMessageType, int)' 
/usr/bin/ld: ibrokers.cpp:(.text+0x9c06): undefined reference to 
`apache::thrift::async::TConcurrentClientSyncInfo::getPending(std::__cxx11::basic_string, std::allocator >&, apache::thrift::protocol::TMessageType&, int&)' 
/usr/bin/ld: CMakeFiles/ibrokers_server.dir/src/gen-cpp/ibrokers.cpp.o: in 
function 
`twsapithrift::ibrokersConcurrentClient::recv_request_historical(std::vector >&, int)': 
ibrokers.cpp:(.text+0xae18): undefined reference to 
`apache::thrift::async::TConcurrentClientSyncInfo::updatePending(std::__cxx11::basic_string, std::allocator > cons
t&, apache::thrift::protocol::TMessageType, int)' 
/usr/bin/ld: ibrokers.cpp:(.text+0xae36): undefined reference to 
`apache::thrift::async::TConcurrentClientSyncInfo::getPending(std::__cxx11::basic_string, std::allocator >&, apache::thrift::protocol::TMessageType&, int&)' 
/usr/bin/ld: CMakeFiles/ibrokers_server.dir/src/gen-cpp/ibrokers.cpp.o: in 
function 
`twsapithrift::ibrokersConcurrentClient::recv_request_matching_symbols(std::vector >&, int)': 
ibrokers.cpp:(.text+0xc048): undefined reference to 
`apache::thrift::async::TConcurrentClientSyncInfo::updatePending(std::__cxx11::basic_string, std::allocator > cons
t&, apache::thrift::protocol::TMessageType, int)' 
/usr/bin/ld: ibrokers.cpp:(.text+0xc066): undefined reference to 
`apache::thrift::async::TConcurrentClientSyncInfo::getPending(std::__cxx11::basic_string, std::allocator >&, apache::thrift::protocol::TMessageType&, int&)' 
collect2: error: ld returned 1 exit status 
gmake[2]: *** [CMakeFiles/ibrokers_server.dir/build.make:247: 
bin/ibrokers_server] Error 1 
gmake[1]: *** [CMakeFiles/Makefile2:83: CMakeFiles/ibrokers_server.dir/all] 
Error 2 
gmake: *** [Makefile:91: all] Error 2 
chmod: cannot access 'ibrokers_server': No such file or directory

{code}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Closed] (THRIFT-5611) v0.16.0 C++ servers suddenly giving brokenpipe errors

2022-08-16 Thread Erik (Jira)


 [ 
https://issues.apache.org/jira/browse/THRIFT-5611?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Erik closed THRIFT-5611.

Resolution: Invalid

closing this.. the error was on my side.. I'd opened up 32 threads on a 4 core 
CPU... and all hell broke loose after that

> v0.16.0 C++ servers suddenly giving brokenpipe errors
> -
>
> Key: THRIFT-5611
> URL: https://issues.apache.org/jira/browse/THRIFT-5611
> Project: Thrift
>  Issue Type: Bug
>  Components: C++ - Library
>Affects Versions: 0.16.0
>Reporter: Erik
>Priority: Major
>
> I jumped from v0.15.0 to v0.16.0 .. and trying to track down what could cause 
> this response in my C++ Server
>  
> {code:java}
> Thrift: Mon Aug 15 22:11:54 2022 TSocket::write_partial() send()  127.0.0.1 Port: 58998>: Broken pipe 
> Thrift: Mon Aug 15 22:11:54 2022 TConnectedClient died: write() send(): 
> Broken pipe 
> Thrift: Mon Aug 15 22:11:54 2022 TConnectedClient output close failed: Called 
> write on non-open socket
> {code}
>  
> my server code is unchanged and was previously okay, I think.. I will keep 
> debugging and trying to ensure it's not me but.. can anyone clue me in on how 
> to repair this ? or what to look for?



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Comment Edited] (THRIFT-5611) v0.16.0 C++ servers suddenly giving brokenpipe errors

2022-08-16 Thread Erik (Jira)


[ 
https://issues.apache.org/jira/browse/THRIFT-5611?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17580115#comment-17580115
 ] 

Erik edited comment on THRIFT-5611 at 8/16/22 7:43 AM:
---

here's the server side function
{code:java}
void request_matching_symbols(std::vector & _return, 
const std::vector & queries_list) {
std::cout << "[hndlr-" << this->handler_num << "] 
request_matching_symbols() queries_list.size() == " << queries_list.size() << 
std::endl;

int batch_size = calculate_batch_size(queries_list.size(), 
this->tws_conn_pool->size());
int remainder  = calculate_remainder(queries_list.size(), 
this->tws_conn_pool->size());

if (batch_size == 1) {
  std::cout << "[hndlr-" << this->handler_num << "] 
request_matching_symbols() Queries list is less than # of clients\n";
  std::future> 
single_future_result;
  SymbolsDataFetcher single_fetcher = 
SymbolsDataFetcher(*this->tws_conn_pool);
  single_future_result = std::async(std::launch::async, 
::process_data, single_fetcher, std::ref(queries_list), 0, 
queries_list.size());

  std::string concetenated_query;
  for (unsigned int i = 0; i < queries_list.size(); i++) {
concetenated_query += queries_list[i] + ", ";
  }

  MatchingSymbolResponse response_obj;
  response_obj.request_query = concetenated_query;
  response_obj.matches;
  
  std::vector result_obj = 
single_future_result.get();
  for (unsigned int j = 0; j < result_obj.size(); j++) {
std::cout << "[hndlr-" << this->handler_num << "] 
request_matching_symbols() PUSHING RESULT INTO RESPONSE\n";
response_obj.matches.push_back(result_obj[j]);
  }
  _return.push_back(response_obj);
  std::cout << "[hndlr-" << this->handler_num << "] 
request_matching_symbols() Setting response_obj\n";
  return;
} {code}


You can see in my ouput I am indeed reaching the return statement but something 
in the client or server is not happy


{code:java}
[hndlr-1] request_matching_symbols() PUSHING RESULT INTO RESPONSE
[hndlr-1] request_matching_symbols() PUSHING RESULT INTO RESPONSE
[hndlr-1] request_matching_symbols() PUSHING RESULT INTO RESPONSE
[hndlr-1] request_matching_symbols() PUSHING RESULT INTO RESPONSE
[hndlr-1] request_matching_symbols() PUSHING RESULT INTO RESPONSE
[hndlr-1] request_matching_symbols() Setting response_obj
Thrift: Tue Aug 16 09:42:29 2022 TSocket::write_partial() send() : Broken pipe
Thrift: Tue Aug 16 09:42:29 2022 TConnectedClient died: write() send(): Broken 
pipe
Thrift: Tue Aug 16 09:42:29 2022 TConnectedClient output close failed: Called 
write on non-open socket {code}


was (Author: emcp):
here's the server side function


{code:java}
void request_matching_symbols(std::vector & _return, 
const std::vector & queries_list) {
std::cout << "[hndlr-" << this->handler_num << "] 
request_matching_symbols() queries_list.size() == " << queries_list.size() << 
std::endl;

int batch_size = calculate_batch_size(queries_list.size(), 
this->tws_conn_pool->size());
int remainder  = calculate_remainder(queries_list.size(), 
this->tws_conn_pool->size());

if (batch_size == 1) {
  std::cout << "[hndlr-" << this->handler_num << "] 
request_matching_symbols() Queries list is less than # of clients\n";
  std::future> 
single_future_result;
  SymbolsDataFetcher single_fetcher = 
SymbolsDataFetcher(*this->tws_conn_pool);
  single_future_result = std::async(std::launch::async, 
::process_data, single_fetcher, std::ref(queries_list), 0, 
queries_list.size());

  std::string concetenated_query;
  for (unsigned int i = 0; i < queries_list.size(); i++) {
concetenated_query += queries_list[i] + ", ";
  }

  MatchingSymbolResponse response_obj;
  response_obj.request_query = concetenated_query;
  response_obj.matches;
  
  std::vector result_obj = 
single_future_result.get();
  for (unsigned int j = 0; j < result_obj.size(); j++) {
std::cout << "[hndlr-" << this->handler_num << "] 
request_matching_symbols() PUSHING RESULT INTO RESPONSE\n";
response_obj.matches.push_back(result_obj[j]);
  }
  _return.push_back(response_obj);
  std::cout << "[hndlr-" << this->handler_num << "] 
request_matching_symbols() Setting response_obj\n";
  return;
} {code}

> v0.16.0 C++ servers suddenly giving brokenpipe errors
> -
>
> Key: THRIFT-5611
> URL: https://issues.apache.org/jira/browse/THRIFT-5611
> Project: Thrift
>  Issue Type: Bug
>  Components: C++ - Library
>Affects Versions: 0.16.0
>Reporter: Erik
>Priority: Major
>
> I jumped from v0.15.0 to v0.16.0 .. and trying to track down what could cause 
> this response in my C++ Server
>  
> {code:java}
> Thrift: Mon Aug 15 22:11:54 

[jira] [Commented] (THRIFT-5611) v0.16.0 C++ servers suddenly giving brokenpipe errors

2022-08-16 Thread Erik (Jira)


[ 
https://issues.apache.org/jira/browse/THRIFT-5611?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17580115#comment-17580115
 ] 

Erik commented on THRIFT-5611:
--

here's the server side function


{code:java}
void request_matching_symbols(std::vector & _return, 
const std::vector & queries_list) {
std::cout << "[hndlr-" << this->handler_num << "] 
request_matching_symbols() queries_list.size() == " << queries_list.size() << 
std::endl;

int batch_size = calculate_batch_size(queries_list.size(), 
this->tws_conn_pool->size());
int remainder  = calculate_remainder(queries_list.size(), 
this->tws_conn_pool->size());

if (batch_size == 1) {
  std::cout << "[hndlr-" << this->handler_num << "] 
request_matching_symbols() Queries list is less than # of clients\n";
  std::future> 
single_future_result;
  SymbolsDataFetcher single_fetcher = 
SymbolsDataFetcher(*this->tws_conn_pool);
  single_future_result = std::async(std::launch::async, 
::process_data, single_fetcher, std::ref(queries_list), 0, 
queries_list.size());

  std::string concetenated_query;
  for (unsigned int i = 0; i < queries_list.size(); i++) {
concetenated_query += queries_list[i] + ", ";
  }

  MatchingSymbolResponse response_obj;
  response_obj.request_query = concetenated_query;
  response_obj.matches;
  
  std::vector result_obj = 
single_future_result.get();
  for (unsigned int j = 0; j < result_obj.size(); j++) {
std::cout << "[hndlr-" << this->handler_num << "] 
request_matching_symbols() PUSHING RESULT INTO RESPONSE\n";
response_obj.matches.push_back(result_obj[j]);
  }
  _return.push_back(response_obj);
  std::cout << "[hndlr-" << this->handler_num << "] 
request_matching_symbols() Setting response_obj\n";
  return;
} {code}

> v0.16.0 C++ servers suddenly giving brokenpipe errors
> -
>
> Key: THRIFT-5611
> URL: https://issues.apache.org/jira/browse/THRIFT-5611
> Project: Thrift
>  Issue Type: Bug
>  Components: C++ - Library
>Affects Versions: 0.16.0
>Reporter: Erik
>Priority: Major
>
> I jumped from v0.15.0 to v0.16.0 .. and trying to track down what could cause 
> this response in my C++ Server
>  
> {code:java}
> Thrift: Mon Aug 15 22:11:54 2022 TSocket::write_partial() send()  127.0.0.1 Port: 58998>: Broken pipe 
> Thrift: Mon Aug 15 22:11:54 2022 TConnectedClient died: write() send(): 
> Broken pipe 
> Thrift: Mon Aug 15 22:11:54 2022 TConnectedClient output close failed: Called 
> write on non-open socket
> {code}
>  
> my server code is unchanged and was previously okay, I think.. I will keep 
> debugging and trying to ensure it's not me but.. can anyone clue me in on how 
> to repair this ? or what to look for?



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Comment Edited] (THRIFT-5611) v0.16.0 C++ servers suddenly giving brokenpipe errors

2022-08-16 Thread Erik (Jira)


[ 
https://issues.apache.org/jira/browse/THRIFT-5611?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17580087#comment-17580087
 ] 

Erik edited comment on THRIFT-5611 at 8/16/22 7:09 AM:
---

attaching my client code (Python)

 
{code:java}
 
import time
from tap_ibkr.core_tws.ibrokers_thrift.gen_py.ibrokers import ibrokers
from thrift.transport import TSocket
from thrift.transport import TTransport
from thrift.protocol import TBinaryProtocol
from tap_ibkr.core_tws.ibrokers_thrift.gen_py.ibrokers.ttypes import 
IBContract, NewsResponse
class TWSAPIThriftClient:
client_connection = None 

def connect_to_thrift_server(self, tws_thrift_host="127.0.0.1", 
ib_host_port=9090):
if self.client_connection is None:
# Make socket transport = TSocket.TSocket(tws_thrift_host, ib_host_port)
# Buffering is critical. Raw sockets are very slow transport = 
TTransport.TBufferedTransport(transport)
# Wrap in a protocol protocol = 
TBinaryProtocol.TBinaryProtocol(transport)
# Create a ibrokers_client to use the protocol encoder client = 
ibrokers.Client(protocol)
# Connect! transport.open()
self.client_connection = client
return self.client_connection
 
if _name_ == "_main_":
temp_client = TWSAPIThriftClient()
temp_client = temp_client.connect_to_thrift_server()
result = temp_client.send_request_matching_symbols(['a', 'tsla'])
print()
{code}
 

 

result comes back `None` on client side


was (Author: emcp):
attaching my client code (Python)

```

{color:#cc7832}import {color}time
{color:#cc7832}from {color}tap_ibkr.core_tws.ibrokers_thrift.gen_py.ibrokers 
{color:#cc7832}import {color}ibrokers
{color:#cc7832}from {color}thrift.transport {color:#cc7832}import {color}TSocket
{color:#cc7832}from {color}thrift.transport {color:#cc7832}import 
{color}TTransport
{color:#cc7832}from {color}thrift.protocol {color:#cc7832}import 
{color}TBinaryProtocol
{color:#cc7832}from 
{color}tap_ibkr.core_tws.ibrokers_thrift.gen_py.ibrokers.ttypes 
{color:#cc7832}import {color}IBContract{color:#cc7832}, {color}NewsResponse


{color:#cc7832}class {color}TWSAPIThriftClient:

client_connection = {color:#cc7832}None
{color}{color:#cc7832}
{color}{color:#cc7832} def 
{color}{color:#ffc66d}connect_to_thrift_server{color}({color:#94558d}self{color}{color:#cc7832},
 {color}tws_thrift_host={color:#6a8759}"127.0.0.1"{color}{color:#cc7832}, 
{color}ib_host_port={color:#6897bb}9090{color}):

{color:#cc7832}if {color}{color:#94558d}self{color}.client_connection 
{color:#cc7832}is None{color}:
{color:#808080}# Make socket
{color}{color:#808080} {color}transport = 
TSocket.TSocket(tws_thrift_host{color:#cc7832}, {color}ib_host_port)
{color:#808080}# Buffering is critical. Raw sockets are very slow
{color}{color:#808080} {color}transport = 
TTransport.TBufferedTransport(transport)
{color:#808080}# Wrap in a protocol
{color}{color:#808080} {color}protocol = 
TBinaryProtocol.TBinaryProtocol(transport)
{color:#808080}# Create a ibrokers_client to use the protocol encoder
{color}{color:#808080} {color}client = ibrokers.Client(protocol)
{color:#808080}# Connect!
{color}{color:#808080} {color}transport.open()

{color:#94558d}self{color}.client_connection = client

{color:#cc7832}return {color}{color:#94558d}self{color}.client_connection


{color:#cc7832}if {color}__name__ == {color:#6a8759}"__main__"{color}:

temp_client = TWSAPIThriftClient()

temp_client = temp_client.connect_to_thrift_server()
result = 
temp_client.send_request_matching_symbols([{color:#6a8759}'a'{color}{color:#cc7832},
 {color}{color:#6a8759}'tsla'{color}])

{color:#c6}print{color}()


```

result comes back `None` on client side

> v0.16.0 C++ servers suddenly giving brokenpipe errors
> -
>
> Key: THRIFT-5611
> URL: https://issues.apache.org/jira/browse/THRIFT-5611
> Project: Thrift
>  Issue Type: Bug
>  Components: C++ - Library
>Affects Versions: 0.16.0
>Reporter: Erik
>Priority: Major
>
> I jumped from v0.15.0 to v0.16.0 .. and trying to track down what could cause 
> this response in my C++ Server
>  
> {code:java}
> Thrift: Mon Aug 15 22:11:54 2022 TSocket::write_partial() send()  127.0.0.1 Port: 58998>: Broken pipe 
> Thrift: Mon Aug 15 22:11:54 2022 TConnectedClient died: write() send(): 
> Broken pipe 
> Thrift: Mon Aug 15 22:11:54 2022 TConnectedClient output close failed: Called 
> write on non-open socket
> {code}
>  
> my server code is unchanged and was previously okay, I think.. I will keep 
> debugging and trying to ensure it's not me but.. can anyone clue me in on how 
> to repair this ? or what to look for?



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Comment Edited] (THRIFT-5611) v0.16.0 C++ servers suddenly giving brokenpipe errors

2022-08-16 Thread Erik (Jira)


[ 
https://issues.apache.org/jira/browse/THRIFT-5611?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17580087#comment-17580087
 ] 

Erik edited comment on THRIFT-5611 at 8/16/22 7:09 AM:
---

attaching my client code (Python)

 
{code:java}
from tap_ibkr.core_tws.ibrokers_thrift.gen_py.ibrokers import ibrokers
from thrift.transport import TSocket
from thrift.transport import TTransport
from thrift.protocol import TBinaryProtocol
from tap_ibkr.core_tws.ibrokers_thrift.gen_py.ibrokers.ttypes import 
IBContract, NewsResponse

class TWSAPIThriftClient:
client_connection = None 

def connect_to_thrift_server(self, tws_thrift_host="127.0.0.1", 
ib_host_port=9090):
if self.client_connection is None:
# Make socket transport = TSocket.TSocket(tws_thrift_host, ib_host_port)
# Buffering is critical. Raw sockets are very slow transport = 
TTransport.TBufferedTransport(transport)
# Wrap in a protocol protocol = 
TBinaryProtocol.TBinaryProtocol(transport)
# Create a ibrokers_client to use the protocol encoder client = 
ibrokers.Client(protocol)
# Connect! transport.open()
self.client_connection = client
return self.client_connection
 
if _name_ == "_main_":
temp_client = TWSAPIThriftClient()
temp_client = temp_client.connect_to_thrift_server()
result = temp_client.send_request_matching_symbols(['a', 'b'])
print()
{code}
 

 

result comes back `None` on client side


was (Author: emcp):
attaching my client code (Python)

 
{code:java}
 
import time
from tap_ibkr.core_tws.ibrokers_thrift.gen_py.ibrokers import ibrokers
from thrift.transport import TSocket
from thrift.transport import TTransport
from thrift.protocol import TBinaryProtocol
from tap_ibkr.core_tws.ibrokers_thrift.gen_py.ibrokers.ttypes import 
IBContract, NewsResponse
class TWSAPIThriftClient:
client_connection = None 

def connect_to_thrift_server(self, tws_thrift_host="127.0.0.1", 
ib_host_port=9090):
if self.client_connection is None:
# Make socket transport = TSocket.TSocket(tws_thrift_host, ib_host_port)
# Buffering is critical. Raw sockets are very slow transport = 
TTransport.TBufferedTransport(transport)
# Wrap in a protocol protocol = 
TBinaryProtocol.TBinaryProtocol(transport)
# Create a ibrokers_client to use the protocol encoder client = 
ibrokers.Client(protocol)
# Connect! transport.open()
self.client_connection = client
return self.client_connection
 
if _name_ == "_main_":
temp_client = TWSAPIThriftClient()
temp_client = temp_client.connect_to_thrift_server()
result = temp_client.send_request_matching_symbols(['a', 'tsla'])
print()
{code}
 

 

result comes back `None` on client side

> v0.16.0 C++ servers suddenly giving brokenpipe errors
> -
>
> Key: THRIFT-5611
> URL: https://issues.apache.org/jira/browse/THRIFT-5611
> Project: Thrift
>  Issue Type: Bug
>  Components: C++ - Library
>Affects Versions: 0.16.0
>Reporter: Erik
>Priority: Major
>
> I jumped from v0.15.0 to v0.16.0 .. and trying to track down what could cause 
> this response in my C++ Server
>  
> {code:java}
> Thrift: Mon Aug 15 22:11:54 2022 TSocket::write_partial() send()  127.0.0.1 Port: 58998>: Broken pipe 
> Thrift: Mon Aug 15 22:11:54 2022 TConnectedClient died: write() send(): 
> Broken pipe 
> Thrift: Mon Aug 15 22:11:54 2022 TConnectedClient output close failed: Called 
> write on non-open socket
> {code}
>  
> my server code is unchanged and was previously okay, I think.. I will keep 
> debugging and trying to ensure it's not me but.. can anyone clue me in on how 
> to repair this ? or what to look for?



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Commented] (THRIFT-5611) v0.16.0 C++ servers suddenly giving brokenpipe errors

2022-08-16 Thread Erik (Jira)


[ 
https://issues.apache.org/jira/browse/THRIFT-5611?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17580087#comment-17580087
 ] 

Erik commented on THRIFT-5611:
--

attaching my client code (Python)

```

{color:#cc7832}import {color}time
{color:#cc7832}from {color}tap_ibkr.core_tws.ibrokers_thrift.gen_py.ibrokers 
{color:#cc7832}import {color}ibrokers
{color:#cc7832}from {color}thrift.transport {color:#cc7832}import {color}TSocket
{color:#cc7832}from {color}thrift.transport {color:#cc7832}import 
{color}TTransport
{color:#cc7832}from {color}thrift.protocol {color:#cc7832}import 
{color}TBinaryProtocol
{color:#cc7832}from 
{color}tap_ibkr.core_tws.ibrokers_thrift.gen_py.ibrokers.ttypes 
{color:#cc7832}import {color}IBContract{color:#cc7832}, {color}NewsResponse


{color:#cc7832}class {color}TWSAPIThriftClient:

client_connection = {color:#cc7832}None
{color}{color:#cc7832}
{color}{color:#cc7832} def 
{color}{color:#ffc66d}connect_to_thrift_server{color}({color:#94558d}self{color}{color:#cc7832},
 {color}tws_thrift_host={color:#6a8759}"127.0.0.1"{color}{color:#cc7832}, 
{color}ib_host_port={color:#6897bb}9090{color}):

{color:#cc7832}if {color}{color:#94558d}self{color}.client_connection 
{color:#cc7832}is None{color}:
{color:#808080}# Make socket
{color}{color:#808080} {color}transport = 
TSocket.TSocket(tws_thrift_host{color:#cc7832}, {color}ib_host_port)
{color:#808080}# Buffering is critical. Raw sockets are very slow
{color}{color:#808080} {color}transport = 
TTransport.TBufferedTransport(transport)
{color:#808080}# Wrap in a protocol
{color}{color:#808080} {color}protocol = 
TBinaryProtocol.TBinaryProtocol(transport)
{color:#808080}# Create a ibrokers_client to use the protocol encoder
{color}{color:#808080} {color}client = ibrokers.Client(protocol)
{color:#808080}# Connect!
{color}{color:#808080} {color}transport.open()

{color:#94558d}self{color}.client_connection = client

{color:#cc7832}return {color}{color:#94558d}self{color}.client_connection


{color:#cc7832}if {color}__name__ == {color:#6a8759}"__main__"{color}:

temp_client = TWSAPIThriftClient()

temp_client = temp_client.connect_to_thrift_server()
result = 
temp_client.send_request_matching_symbols([{color:#6a8759}'a'{color}{color:#cc7832},
 {color}{color:#6a8759}'tsla'{color}])

{color:#c6}print{color}()


```

result comes back `None` on client side

> v0.16.0 C++ servers suddenly giving brokenpipe errors
> -
>
> Key: THRIFT-5611
> URL: https://issues.apache.org/jira/browse/THRIFT-5611
> Project: Thrift
>  Issue Type: Bug
>  Components: C++ - Library
>Affects Versions: 0.16.0
>Reporter: Erik
>Priority: Major
>
> I jumped from v0.15.0 to v0.16.0 .. and trying to track down what could cause 
> this response in my C++ Server
>  
> {code:java}
> Thrift: Mon Aug 15 22:11:54 2022 TSocket::write_partial() send()  127.0.0.1 Port: 58998>: Broken pipe 
> Thrift: Mon Aug 15 22:11:54 2022 TConnectedClient died: write() send(): 
> Broken pipe 
> Thrift: Mon Aug 15 22:11:54 2022 TConnectedClient output close failed: Called 
> write on non-open socket
> {code}
>  
> my server code is unchanged and was previously okay, I think.. I will keep 
> debugging and trying to ensure it's not me but.. can anyone clue me in on how 
> to repair this ? or what to look for?



--
This message was sent by Atlassian Jira
(v8.20.10#820010)