summaryrefslogtreecommitdiff
path: root/cpp/src/qpid/sys
Commit message (Collapse)AuthorAgeFilesLines
* Fix error in NDEBUG builds.Alan Conway2008-01-241-2/+1
| | | | git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@615073 13f79535-47bb-0310-9956-ffa450edef68
* Improved/additional client API tests.Alan Conway2008-01-247-27/+43
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Replaced InProcessBroker with a more accurate loopback BrokerFixture. - Added asserts for mutex/condition/thread errors in debug build. - Added client tests for several exception conditions. - Added peer address to log ouput, client/server distinguished by (addr) or [addr] - Fixed various deadlocks & races exposed by the new asserts & tests. File-by-file: New BrokerFixture replaces InProcessBroker D src/tests/InProcessBroker.h M src/tests/BrokerFixture.h M src/tests/SocketProxy.h M src/tests/Makefile.am Made it run a bit faster. M src/tests/quick_perftest Redundant D src/tests/APRBaseTest.cpp Updated tests to use BrokerFixture M src/tests/ClientChannelTest.cpp M src/tests/exception_test.cpp M src/tests/ClientSessionTest.cpp Print thread IDs in decimal, same as GDB. M src/qpid/log/Logger.cpp Assert mutex/condition ops in debug build. M src/qpid/sys/posix/check.h M src/qpid/sys/posix/Mutex.h M src/qpid/sys/posix/Condition.h M src/qpid/sys/posix/Thread.h Added toFd() so SocketProxy can use ::select() M src/qpid/sys/Socket.h M src/qpid/sys/posix/Socket.cpp Fixes for races & deadlocks shown up by new tests & asserts. Mostly shutdown/close issues. M src/qpid/client/ConnectionHandler.h M src/qpid/client/ConnectionImpl.cpp M src/qpid/client/Demux.h M src/qpid/client/SessionCore.cpp M src/qpid/client/ConnectionHandler.cpp M src/qpid/client/Connector.h M src/qpid/client/Demux.cpp M src/qpid/client/Dispatcher.cpp M src/qpid/client/ConnectionImpl.h Logging peer address. M src/qpid/sys/AsynchIOAcceptor.cpp git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@615063 13f79535-47bb-0310-9956-ffa450edef68
* Some minor changes to doc; primarily aimed at making the list of classesGordon Sim2008-01-231-0/+3
| | | | | | | | listed as client API more useful. git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@614551 13f79535-47bb-0310-9956-ffa450edef68
* Add optional host, port arguments to all example clients.Alan Conway2008-01-182-3/+15
| | | | | | | | | | Verify can start private broker & pass host/port to examples, by default it still uses local host/standard port. Added host:port to Socket error messages. git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@613018 13f79535-47bb-0310-9956-ffa450edef68
* Allow more than one message to be encoded into a single buffer if available.Gordon Sim2008-01-111-2/+12
| | | | git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@611205 13f79535-47bb-0310-9956-ffa450edef68
* Client always collects at least an entire frameset into a single bufferAlan Conway2008-01-102-149/+156
| | | | | | | | | | | | | when possible. Based on patch from Gordon Sim. - Refactor Connector::writebuff, ::send as Connector::Writer - Collect frames up to EOF notifying AIO write. - Encode all available complete framesets into buffers as compactly as possible. - Logging buffer size and frames encoded per write for client and broker. - framing::Buffer added getPosition(), getSize(), default ctor, copy ctor. git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@610972 13f79535-47bb-0310-9956-ffa450edef68
* Provide method to test for empty local queue.Gordon Sim2008-01-041-1/+6
| | | | git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@608915 13f79535-47bb-0310-9956-ffa450edef68
* patch-715 (tross)Carl C. Trieloff2008-01-022-2/+3
| | | | git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@608135 13f79535-47bb-0310-9956-ffa450edef68
* Probable fix for QPID-712:Andrew Stitcher2007-12-201-1/+3
| | | | | | | | | Poller::epollToDirection now treats EPOLLERR as equivalent to EPOLLHUP for purposes of indicating a disconnect from the peer on the write side of the connection git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@605982 13f79535-47bb-0310-9956-ffa450edef68
* * Limited time allowed for reading on a single connection in a single go to 2msAndrew Stitcher2007-12-172-15/+58
| | | | | | | | * Limit bytes allowed to be written on a connection on a single go to the max ever read * Small performance fix for appending to FrameSets git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@604983 13f79535-47bb-0310-9956-ffa450edef68
* Changes to threading: queues serialiser removed, io threads used to drive ↵Gordon Sim2007-11-299-29/+245
| | | | | | | | | | dispatch to consumers Fix to PersistableMessage: use correct lock when accessing synclist, don't hold enqueue lock when notifying queues git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@599395 13f79535-47bb-0310-9956-ffa450edef68
* - Eliminated a race condition on deletion of PollerHandlesAndrew Stitcher2007-11-294-5/+162
| | | | | | | | * Added DeletionManager class to delete handles * Used to stop PollerHandles being deleted whilst still in use git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@599390 13f79535-47bb-0310-9956-ffa450edef68
* Removed obsolete commentAndrew Stitcher2007-11-281-3/+0
| | | | git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@598939 13f79535-47bb-0310-9956-ffa450edef68
* Fixes causing lost 'events' in queue dispatchGordon Sim2007-11-191-1/+1
| | | | git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@596277 13f79535-47bb-0310-9956-ffa450edef68
* Fixed locking (lock was not being released for invocation on callback due to ↵Gordon Sim2007-11-142-3/+14
| | | | | | being locked twice but unlocked only once) git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@594812 13f79535-47bb-0310-9956-ffa450edef68
* - fixed sync mode deadlockCarl C. Trieloff2007-11-131-0/+1
| | | | git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@594655 13f79535-47bb-0310-9956-ffa450edef68
* Moved Serializer notifyWorker inside the mutex.Alan Conway2007-11-132-34/+20
| | | | | | | | Removed user-definable notify function, we want to get rid of Serializer, not reuse it. git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@594537 13f79535-47bb-0310-9956-ffa450edef68
* On Linux, broker defaults --worker-threads to the number of available CPU coresAlan Conway2007-11-092-0/+79
| | | | | | | reported by sysconf(_SC_NPROCESSORS_ONLN) git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@593632 13f79535-47bb-0310-9956-ffa450edef68
* Fix race in destruction of serializer.Gordon Sim2007-11-092-4/+7
| | | | git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@593569 13f79535-47bb-0310-9956-ffa450edef68
* Improved Fix for the race condition where you've got a competing read and writeAndrew Stitcher2007-11-082-74/+15
| | | | | | | | for the same handle. This can happen if we've just got a read event then before handling it we watch for write events and get one immediately. git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@593237 13f79535-47bb-0310-9956-ffa450edef68
* client::SubscriptionManager:Alan Conway2007-11-071-1/+6
| | | | | | | | | | | | | | | | | - Added autoStop support. - Added LocalQueue subscriptions. - Expose AckPolicy settings to user. client::Message: - incoming Messages carry their session for acknowledge perftest: (see perftest --help for details...) - allow multiple consumers. - 3 queue modes: shared, fanout, topic. - set size of messages git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@592869 13f79535-47bb-0310-9956-ffa450edef68
* Added LocalQueue subscriptions. LocalQueue::pop() provides a "pull"Alan Conway2007-11-071-4/+2
| | | | | | | alternative to the MessageListener::received() "push" API. git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@592803 13f79535-47bb-0310-9956-ffa450edef68
* Temporary fix to issue that results in an assertion from Dispatcher.cpp. ↵Gordon Sim2007-11-062-4/+79
| | | | | | Where an interest in write is signalled just as a readable event is triggered it is possible for a writeable (or read-writeable) event to be triggered before the earlier event is processed. This change ensures they are processed serially by queueing them up for the first thread to handle. git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@592485 13f79535-47bb-0310-9956-ffa450edef68
* Added reset function to class AbsTime, thus allowing same instance of ↵Kim van der Riet2007-11-051-0/+6
| | | | | | TimerTask to be reset and used again for the same duration as initially set git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@592170 13f79535-47bb-0310-9956-ffa450edef68
* Modified comment for last change to explain the reasoningGordon Sim2007-11-051-1/+1
| | | | git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@591951 13f79535-47bb-0310-9956-ffa450edef68
* Push buffer back on front when read fails (esp. important when result was ↵Gordon Sim2007-11-051-1/+1
| | | | | | EAGAIN as the buffer may contain unread data) git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@591950 13f79535-47bb-0310-9956-ffa450edef68
* Simplified/improved qpid::sys::RefCountedMap, unit test session attachment ↵Alan Conway2007-11-011-105/+78
| | | | | | use case. git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@591098 13f79535-47bb-0310-9956-ffa450edef68
* Added qpid::sys::RefCountedMap: thread safe refcounted map of refcounted ↵Alan Conway2007-11-011-0/+171
| | | | | | | | | | entries. - Entries are atomically erased when released. - Map is released when all entries are erased. git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@590907 13f79535-47bb-0310-9956-ffa450edef68
* Preparation for session thread safety overhaul:Alan Conway2007-11-012-2/+2
| | | | | | | | | | - simplified SessionState, responsibility for protocol states now in Handlers - qpid::RefCounted, qpid::intrusive_ptr reference counting support. - build boost unit tests as single exe, speeds up testing. - fixed leak in AsynchIOAcceptor.cpp git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@590869 13f79535-47bb-0310-9956-ffa450edef68
* Simple fix to prevent concurrent disconnection and sending of frames causing ↵Gordon Sim2007-10-312-0/+79
| | | | | | | | | | seg faults. A more complete solution may follow. git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@590786 13f79535-47bb-0310-9956-ffa450edef68
* Fix client side core dump when disconneced unexpectedly:Alan Conway2007-10-311-1/+4
| | | | | | | | | | | | | | void qpid::client::SessionCore::invariant() const: Assertion Minor items: src/qpid/broker/Queue.cpp: info log for each message dispatched. src/qpid/broker/SessionHandler.cpp: check attached in handleOut() src/qpid/sys/Dispatcher.cpp: use polymorphic_downcast to catch cast errors in debug builds. src/qpid/client/SessionCore.cpp: fix incorrect asserts src/qpid/client/Message.h: convenience constructor parameters git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@590688 13f79535-47bb-0310-9956-ffa450edef68
* client/BlockingQueue.h, sys/ConcurrentQueue.h: merged to sys/BlockingQueue.hAlan Conway2007-10-293-126/+140
| | | | | | | | | - updated all users qpid/Exception.h: Removed unimplemented clone() function. git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@589857 13f79535-47bb-0310-9956-ffa450edef68
* Avoid use of wait(AbsTime::farFuture()) - causes hanging on 32 bit.Alan Conway2007-10-291-7/+4
| | | | git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@589636 13f79535-47bb-0310-9956-ffa450edef68
* Session resume support in client & broker: Client can resume a sessionAlan Conway2007-10-2612-136/+215
| | | | | | | | | | | | | | | | | | | | | | | | | after voluntary suspend() or network failure. Frames lost in network failure are automatically re-transmitted for transparent re-connection. client::Session improvements: - Locking to avoid races between network & user threads. - Replaced client::StateManager with sys::StateMonitor - avoid heap allocation. qpid::Exception clean up: - use QPID_MSG consistently to format exception messages. - throw typed exceptions (in reply_exceptions.h) for AMQP exceptions. - re-throw correct typed exception on client for exceptions from broker. - Removed QpidError.h rubygen/templates/constants.rb: - constants.h: Added FOO_CLASS_ID and FOO_BAR_METHOD_ID constants. - reply_constants.h: Added throwReplyException(code, text) log::Logger: - Fixed shutdown race in Statement::~Initializer() git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@588761 13f79535-47bb-0310-9956-ffa450edef68
* Record peer address (for logging purposes) on initiation rather than on ↵Gordon Sim2007-10-221-11/+14
| | | | | | every logged message. git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@587054 13f79535-47bb-0310-9956-ffa450edef68
* Fix for leak on receiving eof on networkAndrew Stitcher2007-10-191-7/+3
| | | | git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@586345 13f79535-47bb-0310-9956-ffa450edef68
* Log a warning if we close a connection with unsent dataAndrew Stitcher2007-10-162-1/+6
| | | | git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@585127 13f79535-47bb-0310-9956-ffa450edef68
* * Revised allocation algorithm to ensure all consumers are given the ↵Gordon Sim2007-10-161-6/+4
| | | | | | | | | | | opportunity to consume a message * If already have infinit credit, don't try to add to it * If get disconnected while processing close, just finish off the close and don't signal the disconnection git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@585085 13f79535-47bb-0310-9956-ffa450edef68
* Include information on the client connection in io traces.Gordon Sim2007-10-153-17/+61
| | | | git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@584755 13f79535-47bb-0310-9956-ffa450edef68
* Close connection when a framing error is encountered during decoding.Gordon Sim2007-10-122-29/+37
| | | | git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@584143 13f79535-47bb-0310-9956-ffa450edef68
* * Changes to make C++ client code use the asynchronous network IOAndrew Stitcher2007-08-313-24/+22
| | | | | | | | * Fixed up the test for buffer changes * Removed unused buffer operations git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@571529 13f79535-47bb-0310-9956-ffa450edef68
* * src/qpid/sys/Serializer.h, .cpp:Alan Conway2007-08-212-91/+110
| | | | | | | | | | | Template Serializer on functor for execute(). Old Serializer equivalent to Serializer<boost::function<void()> > * src/qpid/broker/BrokerQueue.h, .cpp: Use hand-written functor for Serializer instead of boost::function. git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@568332 13f79535-47bb-0310-9956-ffa450edef68
* AMQBodies are no longer allocated on the heap and passed with shared_ptr.Alan Conway2007-08-161-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | AMQFrame contains a boost::variant of AMQHeaderBody,AMQContentBody, AMQHeatbeatBody, and MethodHolder. A variant is basically a type-safe union, it can allocate any of the types in-place. MethodHolder contains a Blob, a less sophisticated kind of variant, which can contain any of the concrete method body types. Using variants for all the method types causes outrageous compile times and bloated library symbol names. Blob lacks some of the finer features of variant and needs help from generated code. For now both are hidden to the rest of the code base behind AMQFrame and MethodBody classes so if/when we decide to settle on just one "variant" type solution we can do so. This commit touches nearly 100 files, mostly converting method signatures with shared_ptr<FooBody> to FooBody* or FooBody&, and converting stored shared_ptr<AMQBody> to AMQFrame and share_ptr<AMQMethodBody> to MethodHolder. There is one outstanding client memory leak, which I will fix in my next commit. git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@566822 13f79535-47bb-0310-9956-ffa450edef68
* r948@fuschia: andrew | 2007-08-09 18:46:30 +0100Andrew Stitcher2007-08-092-5/+5
| | | | | | | | | | | | | | | | | | | | | r913@fuschia: andrew | 2007-08-07 12:56:10 +0100 Removed extraneous parameter when creating Broker Acceptor r949@fuschia: andrew | 2007-08-09 18:46:30 +0100 r914@fuschia: andrew | 2007-08-07 12:56:55 +0100 Work in Progress: making the client library use the AsynchIO layer r950@fuschia: andrew | 2007-08-09 18:46:30 +0100 r937@fuschia: andrew | 2007-08-09 02:29:41 +0100 Shutdown connection properly r951@fuschia: andrew | 2007-08-09 18:46:31 +0100 r952@fuschia: andrew | 2007-08-09 19:27:03 +0100 Finishing touches to first cut of AsynchIO for client git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@564333 13f79535-47bb-0310-9956-ffa450edef68
* * src/tests/start_broker: Pass script parameters to broker.Alan Conway2007-08-082-6/+5
| | | | | | | | | | | | | * src/qpid/sys/Serializer.cpp: Corrected log levels. * src/tests/.valgrind.supp-default: Suppress probably benign leaks and uninit param errors from asynch IO code. Need verification they are beningn. * src/qpid/sys/AsynchIOAcceptor.cpp(run): Fix memory leak. git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@563879 13f79535-47bb-0310-9956-ffa450edef68
* * Changed Broker queue processing to avoid unnecessary uses of boost::bindAndrew Stitcher2007-08-022-2/+2
| | | | | | | * Changed Serializer::execute to take Tasks by reference to avoid overhead of copying git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@562179 13f79535-47bb-0310-9956-ffa450edef68
* Recoded writing code so that it doesn't allocate framing::Buffer on the heapAndrew Stitcher2007-08-011-33/+27
| | | | git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@561877 13f79535-47bb-0310-9956-ffa450edef68
* * Fix crash on shutdown due to underlying poller being shutdown twiceAndrew Stitcher2007-07-311-0/+4
| | | | | | | - Actually just made the poller ignore subsequent shutdown attempts git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@561279 13f79535-47bb-0310-9956-ffa450edef68
* r797@fuschia: andrew | 2007-07-30 14:25:02 +0100Andrew Stitcher2007-07-307-813/+0
| | | | | | | | * Removed all the leader-follower acceptor code (APR based acceptor) * Removed the --enable/disable-apr-netio option to configure git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@560973 13f79535-47bb-0310-9956-ffa450edef68
* * Asynchronous network IO subsystemAndrew Stitcher2007-07-2723-1852/+681
| | | | | | | | | | | | | | | | | | - This is now implemented such that it very nearly only depends on the platform code (Socker & Poller), this is not 100% true at present, but should be simple to finish. - This is still not the default (use "./configure --disable-apr-netio" to get it) - Interrupting the broker gives a known error - Default for number of broker io threads is not correct (needs to be number of CPUs - it will run slower with too many io threads) * EventChannel code - Deleted all EventChannel code as it's entirely superceded by this new shiny code ;-) * Rearranged the platform Socket implementations a bit for better abstraction git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@560323 13f79535-47bb-0310-9956-ffa450edef68