Commit Graph

243 Commits

Author SHA1 Message Date
eletuchy
66ccee2a74 [thrift] java httpclient needs to close its inputstream
Reviewed By: mcslee

Test Plan: run as part of aim importer

Revert Plan: sure

Notes:

EImportant:


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665142 13f79535-47bb-0310-9956-ffa450edef68
2007-06-25 18:29:28 +00:00
Mark Slee
0e1100c921 Ruby TBinaryProtocol fix
Summary: VERSION_1 | type, not &, wrong binary operator

Reviewed By: binary

Test Plan: TestClient.rb


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665141 13f79535-47bb-0310-9956-ffa450edef68
2007-06-23 00:08:13 +00:00
Mark Slee
a9294a9522 Teensy insignificant thrift bug
Summary: Wasn't causing any issues because it's a noop with the binary protocol

Reviewed By: jwang

Test Plan: honky tonk, no diff in functionality


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665140 13f79535-47bb-0310-9956-ffa450edef68
2007-06-22 19:43:12 +00:00
Mark Slee
552410c037 Idiotic typos in Python code
Summary: No clue how this slid in

Reviewed By: abosworth

Test Plan: I am stupid. TestClient.py


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665139 13f79535-47bb-0310-9956-ffa450edef68
2007-06-22 01:03:55 +00:00
Mark Slee
808454ec63 Thrift TBinaryProtocol change
Summary: New Thrift TBinaryProtocol with a version identifier

Reviewed By: aditya, eugene

Test Plan: Modify your services to have strictRead_ and strictWrite_ both set to FALSE. Then redeploy your services and test running clients against them. Once you have clients and servers running stably on this new code, you should redploy versions with strictWrite_ set to TRUE. Once that's all good, we can set strictRead_ to TRUE as well, and eventually deprecate the old protocol code entirely.


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665138 13f79535-47bb-0310-9956-ffa450edef68
2007-06-20 21:51:57 +00:00
dweatherford
589859984f [thrift] Add optional callback inside of serve()
Summary: If enabled, the callback function will be run after the listening socket is opened and the event loop initialized, just prior to calling event_loop()

This is handy if you want to defer some of your initialization until after the socket is open -- allowing clients to connect, but not processing requests until the initialization is complete. I use this in the Synapse tablet server to minimize the communications interruption that happens during a tablet split (replaying commit logs after opening the listening socket).

Review: mcslee
Test Plan: compiled it into Synapse's tablet server
Revert: ok


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665137 13f79535-47bb-0310-9956-ffa450edef68
2007-06-19 23:10:19 +00:00
Mark Slee
8eceaeacfb Missing variable in initializer list for TNonblockingServer constructor
Summary: Making tablemaster very unhappy

Reviewed By: dweatherford

Test Plan: tablemaster on synampse tier


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665135 13f79535-47bb-0310-9956-ffa450edef68
2007-06-15 01:43:21 +00:00
Mark Slee
1d2ead34a2 Darwin endianness junk
Reviewed By: darwin

Test Plan: build on OSX


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665133 13f79535-47bb-0310-9956-ffa450edef68
2007-06-09 01:23:04 +00:00
Mark Slee
e02385b0b4 Add thread pool option to NonblockingServer
Summary: If you want requests processed outside of the I/O thread

Reviewed By: jake luciani, aditya

Test Plan: nb-main.cpp, in the test folder


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665132 13f79535-47bb-0310-9956-ffa450edef68
2007-06-09 01:21:16 +00:00
boz
6ded775196 THRIFT: generic output handler
Summary: I'm tired of getting output from thrift via perror AND exceptions, so
this class allows the client to set an alternate (or empty) handler for error
output

Reviewed By: mcslee

Test Plan: I ran on the worker with the default, got output via perror, then
overloaded with my own function and got output via syslog and then NULL


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665131 13f79535-47bb-0310-9956-ffa450edef68
2007-06-05 22:41:18 +00:00
Marc Slemko
a647903dd2 Modified PosixThreadFactory
Added explicit detached getter and setter
Modified PosixThreadFactory::~PThread:
        Check for join failing and don't transition to detached_ state if it does.  Potential thread-handle leak for
        threads created joinable who aren't referenced by any external thread.  Solution for now has to be
        "DONT DO THAT", the clever approach doesn't always work.

Added ThreadFactoryTests.floodNThreads:
        Loop M times for N threads where M x N is bigger than 32K to verify that detached threads can be created
        ad infinitum.

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@665130 13f79535-47bb-0310-9956-ffa450edef68
2007-06-05 22:20:14 +00:00
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