You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@thrift.apache.org by "Ben Craig (JIRA)" <ji...@apache.org> on 2013/10/07 15:23:42 UTC
[jira] [Commented] (THRIFT-1682) Multiple thread calling a Service
function unsafely causes message corruption and terminates with Broken Pipe
[ https://issues.apache.org/jira/browse/THRIFT-1682?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13788128#comment-13788128 ]
Ben Craig commented on THRIFT-1682:
-----------------------------------
C++ client objects are not intended to be thread safe. Customer code is expected to synchronize access to those objects. The behavior you are seeing is expected.
> Multiple thread calling a Service function unsafely causes message corruption and terminates with Broken Pipe
> -------------------------------------------------------------------------------------------------------------
>
> Key: THRIFT-1682
> URL: https://issues.apache.org/jira/browse/THRIFT-1682
> Project: Thrift
> Issue Type: Bug
> Components: C++ - Library
> Affects Versions: 0.7, 0.8, 0.9
> Environment: Linux Kernel: 2.6.32-42-generic (Ubuntu 10.04)
> Reporter: Felipe Toledo G Oliveira
> Priority: Critical
> Labels: c++, corruption, thread-safe, thread-safety, threading
> Attachments: BrokenPipeCpp_src.tar.gz
>
>
> If more than one thread attempts to send messages using the same Client instance, one of the threads corrupts another thread's parameter values and terminates program displaying Broken Pipe.
> If the Service function is locked with a Mutex, the issue stops occurring.
> See the following log fragment, displaying 'Unknown[*]', where '*' is a corrupt value.
> <log fragment>
> Thrift: Tue Aug 28 13:12:00 2012 TSimpleServer uncaught exception.
> virtual void FooHandler::bar(int32_t, zoo::StateType::type, zoo::WeekdayType::type): id: 0, state: Unknown[152587096], weekday: Unknown[152587096]
> Thrift: Tue Aug 28 13:12:00 2012 TSocket::write_partial() send() <Host: 127.0.0.1 Port: 9000>Broken pipe
> terminate called after throwing an instance of 'std::exception'
> what(): std::exception
> void FooPeer::bar(int32_t, zoo::StateType::type, zoo::WeekdayType::type): Exception: write() send(): Broken pipe
> void FooPeer::bar(int32_t, zoo::StateType::type, zoo::WeekdayType::type): id: 0, state: START, weekday: TUESDAY
> </log fragment>
> Please, check our sample code at 'BrokenPipeCpp_src.tar.gz' in order to reproduce this error.
> Regards,
> Felipe
--
This message was sent by Atlassian JIRA
(v6.1#6144)