Commit Graph

232 Commits

Author SHA1 Message Date
Marc Slemko
67606e5d72 Modified PosixThreadFactory::PThread:
Pay attention to detached flags.  If thread is create non-detached and has not been joined when all references are given up,
        (ie boost::share_ptr calls ~PThread) do the join in the destructor to prevent thread ids from being leaked.

Modified ThreadFactoryTests.reapNThreads:
        Loop M times for M threads where M x N is bigger than 32K to verify that thread ids aren't leaked

Modified TimerManager.cpp:
        Removed debug messages.

Reviewed By: mcslee

Revert Plan: revertible

Test Plan: concurrency_test thread-factory passes


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665129 13f79535-47bb-0310-9956-ffa450edef68
2007-06-04 21:01:19 +00:00
Mark Slee
5e707a6cd9 Forgot to add ProcessorFactory
Reviewed By: biren


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665128 13f79535-47bb-0310-9956-ffa450edef68
2007-06-01 23:04:09 +00:00
boz
f83c9dbf6f THRIFT: ADITYASLOP
Summary: thrift didn't compile

Reviewed By: marc

Test Plan: thrift compiles


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665127 13f79535-47bb-0310-9956-ffa450edef68
2007-05-31 23:38:37 +00:00
Mark Slee
7a2fb142f1 Memory buffer for perl
Reviewed By: Jake Luciani


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665126 13f79535-47bb-0310-9956-ffa450edef68
2007-05-31 02:30:34 +00:00
Aditya Agarwal
7859a579db -- handle EINTRS in accept()
Summary:
- I love unix.

Reviewed By: mcslee

Test Plan: boz will test it


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665125 13f79535-47bb-0310-9956-ffa450edef68
2007-05-31 01:33:07 +00:00
Mark Slee
448849deed ProcessorFactory for Java
Reviewed By: simon forman


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665124 13f79535-47bb-0310-9956-ffa450edef68
2007-05-31 01:30:22 +00:00
Mark Slee
9b82d275c6 Get the long longs out of the Thrift codebase
Summary: Replace with int64_t and don't worry about what architecture machine you're on, the typedefed int64_t will do the right thing.

Reviewed By: aditya, marc


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665123 13f79535-47bb-0310-9956-ffa450edef68
2007-05-23 05:16:07 +00:00
Mark Slee
2782d6d205 mcslee: being nitpicky ensuring consistent coding style
Summary: no tabs, conditionals with spaces around them, etc

Reviewed By: thrift style rules


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665122 13f79535-47bb-0310-9956-ffa450edef68
2007-05-23 04:55:30 +00:00
Aditya Agarwal
e04475b5aa -- fix read timeout handling in TSocket
Summary:
- turns out that EAGAIN can be returned both when there is a transmission timeout and when there
  is a lack of system resources.

This diff has a hacky fix for respecting a user specified read timeout.

Reviewed By: Steve Grimm, Marc, Slee

Test Plan:
- Tested by trying to crash an srp machine

Revert Plan: No.

Notes:
- Also added functionality to allow users to specify the max number of recv retries (in the case
  when EAGAIN is returned due to a lack of system resources)


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665121 13f79535-47bb-0310-9956-ffa450edef68
2007-05-23 02:14:58 +00:00
Marc Slemko
3a3b53bc6e Modified facebook::thrift::concurrency::Monitor.wait:
Throw TimedOutException on wait timeout so caller can distinguish between timeout and event.

Modified facebook::thrift::concurrency::PthreadThread.start:
        Throw SystemrResourceException on any pthread_* function call failure rather than asserting 0.

Added facebook::thrift::concurrency::Thread.id() and  facebook::thrift::concurrency::ThreadFactory.currentThreadId():
        Return thread-id of thread and current thread respectively.  Needed for reentrancy tests in ThreadManager

Added facebook::thrift::concurrency::ThreadManager.pendingTaskCountMaxN
Modified facebook::thrift::concurrency::ThreadManager.add():
        Now support a maximum pending task count and block if the current pending task count is max.
        If timeout is specified for add, TimedOutException is thrown if pending task count doesn't decrease
        in the timeout interval.  If add() is called by a ThreadManager worker thread and the task cannot
        be added, a TooManyPendingTasksException is thrown rather than blocking, since deadlocks can ensue
        if worker threads block waiting for works threads to complete tasks.

Reviewed By: mcslee, aditya

Revert Plan: revertible

Test Plan: concurrency/test/ThreadManagerTests.h
           run concurrency-test thread-manager


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665120 13f79535-47bb-0310-9956-ffa450edef68
2007-05-22 23:59:54 +00:00
Mark Slee
8168706fe9 Fix Thrift perl framedtransport
Reviewed By: jake luciani


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665117 13f79535-47bb-0310-9956-ffa450edef68
2007-05-16 02:44:21 +00:00
Mark Slee
bf82151094 Some filetransport indentation and style fixes
Reviewed By: null, no code change, style only


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665114 13f79535-47bb-0310-9956-ffa450edef68
2007-05-16 02:31:53 +00:00
Mark Slee
254ce20e51 Perl library for Thrift
Summary: Submitted by Jake Luciani

Reviewed By: mcslee


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665112 13f79535-47bb-0310-9956-ffa450edef68
2007-05-16 02:21:06 +00:00
boz
1ea81ce9b0 THRIFT: configurable retry settings for bind
Summary: SO_REUSEADDR doesn't always work, and some of my servers have
expensive init routines that I really want to run before it becomes available
to services, so I want thrift to retry the bind several times at varied
intervals before giving up

Reviewed By: slee

Test Plan: running a service in GDB with no problems binding, with another
service bound to the port for all the retries, another service bound to the
port for only some of the retries


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665109 13f79535-47bb-0310-9956-ffa450edef68
2007-05-14 23:04:33 +00:00
Mark Slee
5f68c7161d Fix messed up exception error printing
Reviewed By: boz

Test Plan: comes up in feed


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665107 13f79535-47bb-0310-9956-ffa450edef68
2007-05-11 17:58:54 +00:00
jsobel
e02e424486 thrift: cpp tsocketpool support
summary: simple port of tsocketpool from php to cpp. missing a lot of functionality due to lack of apc support
review: slee


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665106 13f79535-47bb-0310-9956-ffa450edef68
2007-05-08 17:51:49 +00:00
Mark Slee
3690ee412a TEOFException must publicly inherit TTransportException
Reviewed By: boz

Test Plan: Queuemap


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665105 13f79535-47bb-0310-9956-ffa450edef68
2007-05-07 22:54:18 +00:00
James Wang
4fd2dbaf06 Thrift: Fixing memory leak issue with memory buffer used in TPipedTransport
Reviewed by: boz

Test Plan: tested with falcon action_listener using PeekProcessor


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665101 13f79535-47bb-0310-9956-ffa450edef68
2007-04-17 22:38:58 +00:00
James Wang
5f45207ee9 Thrift: Modifications to PeekProcessor to be able to support nested PeekProcessors
Reviewed by: boz

Test Plan: Tested with Falcon


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665100 13f79535-47bb-0310-9956-ffa450edef68
2007-04-13 20:10:39 +00:00
Mark Slee
8d725a2738 Add explicit binary type to Thrift
Summary: Identical to string in all languages except Java. Java String is NOT binary-safe, so we need to use raw byte[] in that case. PHP/RUBY/Python strings are all binary safe, and C++ std::string works fine and manages memory for you so it's the safest route. Java just needs this tweak.

Reviewed By: aditya

Test Plan: Use "binary" as a type instead of String.


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665099 13f79535-47bb-0310-9956-ffa450edef68
2007-04-13 01:57:12 +00:00
Mark Slee
4f261c5b23 Crazy byteswapping thrift patches from david reiss
Reviewed By: ninjitsu

Test Plan: bswap64, holla holla


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665098 13f79535-47bb-0310-9956-ffa450edef68
2007-04-13 00:33:24 +00:00
Aditya Agarwal
8dc76e6a87 -- trying to make TFileTransport destructor quicker
Summary:
- setFlushMaxTimeUs to a lower value before trying to close the file

Reviewed By: jwang


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665095 13f79535-47bb-0310-9956-ffa450edef68
2007-04-11 00:13:09 +00:00
Aditya Agarwal
89b85f87d8 -- fix issues with TFileTransport
Summary:
- Make sure that buffers are always emptied when destructor is called (or when file is closed)
- make flush a no-op if file is not open
- dont allow new events to be enqueued if the file is in the process of being closed

Reviewed By: slee, jwang

Test Plan: tested with building search indices on top of thrift logs


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665094 13f79535-47bb-0310-9956-ffa450edef68
2007-04-10 23:15:04 +00:00
James Wang
c10bba1e16 Thrift: Checking in readonly option for TFileTransport
Reviewed by: boz


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665093 13f79535-47bb-0310-9956-ffa450edef68
2007-04-10 17:29:06 +00:00
dweatherford
86efa70748 [thrift] Build fix for TFileTransport
Summary: Not including config.h means we never get the HAVE_CLOCK_GETTIME #define, breaking the build with a duplicate function definition on machines that have a clock_gettime() function in the standard library.

Reviewed By: slee
Test Plan: it compiles, ship it
Revert: ok


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665087 13f79535-47bb-0310-9956-ffa450edef68
2007-04-05 00:20:40 +00:00
Mark Slee
ff24f74b49 Oops typo.
Reviewed By: mcslee


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665086 13f79535-47bb-0310-9956-ffa450edef68
2007-04-04 22:13:37 +00:00
Mark Slee
a28d819d13 Build fixes and clock_get_time copy from paul querna
Reviewed By: mcslee


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665085 13f79535-47bb-0310-9956-ffa450edef68
2007-04-04 22:11:17 +00:00
Mark Slee
82a6c0f259 Thrift string copy construction pathces from kevin ko
Summary: Remove unnecessary string copy constructions in C++ code

Reviewed By: mcslee

Test Plan: build


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665084 13f79535-47bb-0310-9956-ffa450edef68
2007-04-04 21:08:21 +00:00
Mark Slee
ba35456acf Fix build script reference problem
Reviewed By: pquerna@apache.org

Test Plan: build w/o libevent installed


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665081 13f79535-47bb-0310-9956-ffa450edef68
2007-04-03 07:31:51 +00:00
Mark Slee
13a0d4a3d6 PHP new build fix for TBinaryProtocol
Reviewed By: shire


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665079 13f79535-47bb-0310-9956-ffa450edef68
2007-04-03 03:16:11 +00:00
Mark Slee
ba8f8d7953 Remove extra TApplicationException:: in Thrift.h
Summary: G++ 4.1.1 compatibility

Reviewed By: alex tribble


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665078 13f79535-47bb-0310-9956-ffa450edef68
2007-04-03 00:34:00 +00:00
Marc Slemko
b6b5a9e001 Removed comment about needing a lock in thread main. Access through boost::shared_ptr is thread safe
Reviewed By: none

Test Plan: N.A.


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665076 13f79535-47bb-0310-9956-ffa450edef68
2007-04-01 20:17:02 +00:00
Aditya Agarwal
3f234dad0e -- more assert fixes for thrift concurrency
Reviewed By: mcslee


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665074 13f79535-47bb-0310-9956-ffa450edef68
2007-04-01 01:19:57 +00:00
Aditya Agarwal
9dc57402b5 -- assert fixes for thrift concurrency lib
Summary:
- cannot assume that assert.h is defined

Reviewed By: marc k

Test Plan: everything compiles

Notes:
- need to reflect these changes in libfacebook/fbthread


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665073 13f79535-47bb-0310-9956-ffa450edef68
2007-03-31 17:45:12 +00:00
Martin Kraemer
ac62f948cc Thrift - remove client disconnect error
Summary:
It's fairly obnoxious.

Reviewed By: Slee and Karl

Test Plan:

Revert Plan: revertible

Notes:


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665069 13f79535-47bb-0310-9956-ffa450edef68
2007-03-30 18:41:48 +00:00
James Wang
f1ceb477ea Thrift: Making TProcessor::process(io) non-virtual again, since my last change which made it virtual caused compiling errors of functions being hidden, ugh
Reviewed by: Karl


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665068 13f79535-47bb-0310-9956-ffa450edef68
2007-03-28 22:43:57 +00:00
James Wang
8f6e207a5d Thrift: PeekProcessor - moving PeekEnd call after PeekBuffer
Reviewed by: boz


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665067 13f79535-47bb-0310-9956-ffa450edef68
2007-03-28 00:47:09 +00:00
James Wang
3e9d177fd2 Thrift: Adding StatsProcessor, PeekProcessor, TPipedFileReaderTransport, and TPipedFileReaderTransportFactory classes
- StatsProcessor can be used to print events, or keep track of event frequency
- PeekProcessor is used to examine data in a thrift event, prior to passing it along to an underlying processor
- TPipedFileReaderTransport and its factory are used to pipe a TFileReaderTransport (which TFileProcessor requires)

Also fixed some bugs in TFileTransport - next flush time was overflowing and not always being reset

Reviewed by: aditya, mcslee

Test Plan: Tested using various thrift clients (scribe, falcon) and gdb in sandbox and on dev008.


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665066 13f79535-47bb-0310-9956-ffa450edef68
2007-03-27 23:17:34 +00:00
Mark Slee
be0ae5b1be Fix heinous TMemoryBuffer bug and warning in FileTransport
Reviewed By: dweatherford


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665065 13f79535-47bb-0310-9956-ffa450edef68
2007-03-22 02:35:33 +00:00
Mark Slee
a821cfd39f Missed an include line in sample code
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665064 13f79535-47bb-0310-9956-ffa450edef68
2007-03-21 06:53:03 +00:00
Mark Slee
06af13d308 Readme on PHP/Apache Thrift integration
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665063 13f79535-47bb-0310-9956-ffa450edef68
2007-03-21 06:50:52 +00:00
Mark Slee
7679196f1c Various Thrift fixes, including Application Exception support in Ruby, better errror messages across languages, etc.
Reviewed By: thrift


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665058 13f79535-47bb-0310-9956-ffa450edef68
2007-03-14 02:47:35 +00:00
Mark Slee
561b536888 Fix TServerSocket accept() to not do 200ms polling
Summary: Better to signal to unix file in select

Reviewed By: marc


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665056 13f79535-47bb-0310-9956-ffa450edef68
2007-03-09 19:26:29 +00:00
Aditya Agarwal
4265a2c4d9 -- Fix compiler warnings
Summary:
- These showed up when I was compiling on my local machine (cygwin!!)

Reviewed By: thrifty


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665055 13f79535-47bb-0310-9956-ffa450edef68
2007-03-08 03:10:29 +00:00
Mark Slee
b6616fc42d No such thing as e.message in python socket error?
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665052 13f79535-47bb-0310-9956-ffa450edef68
2007-03-07 05:46:05 +00:00
Mark Slee
1d4ce80af8 Implement proper TThreadedServer shutdown
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665049 13f79535-47bb-0310-9956-ffa450edef68
2007-03-07 05:16:16 +00:00
Mark Slee
54b7ab9b53 READMEs and DOCs and ant tasks, oh my
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665048 13f79535-47bb-0310-9956-ffa450edef68
2007-03-06 00:06:27 +00:00
Mark Slee
5ea15f9e32 Get rid of all the using namespace and using boost:: declarations in Thrift header files
Summary: To remove upstream dependencies. Still keeping some specific using directives around.


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665047 13f79535-47bb-0310-9956-ffa450edef68
2007-03-05 22:55:59 +00:00
Mark Slee
5d06feab21 Thrift build cleanup stuff
Summary: Get rid of autoconf stuff for lib/php, it doesn't do anything


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665046 13f79535-47bb-0310-9956-ffa450edef68
2007-03-05 22:18:18 +00:00
Mark Slee
3303f36081 Thrift CPP threading fixes
Reviewed By: karl


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665045 13f79535-47bb-0310-9956-ffa450edef68
2007-03-05 20:09:37 +00:00