[asterisk-scf-commits] asterisk-scf/release/bridging.git branch "master" updated.
Commits to the Asterisk SCF project code repositories
asterisk-scf-commits at lists.digium.com
Tue May 31 07:34:29 CDT 2011
branch "master" has been updated
via e52dc2dbaa0b0afd56ef90dae7d8371eac83e871 (commit)
from 59387df4b80bb1ccc1b84c13a130979698a2dc1f (commit)
Summary of changes:
src/BridgeImpl.cpp | 5 ++++-
src/BridgeServiceConfig.h | 2 +-
src/SessionCollection.cpp | 8 --------
src/SessionListener.cpp | 3 ++-
src/Tasks.h | 14 +++++++-------
5 files changed, 14 insertions(+), 18 deletions(-)
- Log -----------------------------------------------------------------
commit e52dc2dbaa0b0afd56ef90dae7d8371eac83e871
Author: Brent Eagles <beagles at digium.com>
Date: Tue May 31 10:03:55 2011 -0230
Some logging fixes and adding some missing reaping that was complicating shutdown.
diff --git a/src/BridgeImpl.cpp b/src/BridgeImpl.cpp
index 0cf2807..29e4849 100755
--- a/src/BridgeImpl.cpp
+++ b/src/BridgeImpl.cpp
@@ -527,6 +527,7 @@ void BridgeImpl::addSessions_async(const AMD_Bridge_addSessionsPtr& callback, co
{
try
{
+ mSessions->reap();
if (sessions.empty())
{
if (callback)
@@ -575,6 +576,7 @@ void BridgeImpl::removeSessions_async(const AMD_Bridge_removeSessionsPtr& callba
}
checkSessions(sessions);
statePreCheck();
+ mSessions->reap();
//
// The shutdown of individual sessions are implemented as series of AMI requests. Once initiated,
@@ -619,6 +621,7 @@ SessionSeq BridgeImpl::listSessions(const Ice::Current& current)
void BridgeImpl::shutdown(const Ice::Current& current)
{
+ mSessions->reap();
//
// In an effort to allow some consistency with replicas, the shutdown operation is broken into
// two parts. In an asynchronous version, this would probably be a couple of queued tasks.
@@ -763,7 +766,7 @@ void BridgeImpl::replaceSession_async(const AMD_Bridge_replaceSessionPtr& callba
try
{
mLogger(Debug) << FUNLOG << ":" << objectIdFromCurrent(current);
-
+ mSessions->reap();
checkSessions(newSessions);
statePreCheck();
diff --git a/src/BridgeServiceConfig.h b/src/BridgeServiceConfig.h
index 6f61e68..5452f5e 100644
--- a/src/BridgeServiceConfig.h
+++ b/src/BridgeServiceConfig.h
@@ -60,7 +60,7 @@ private:
};
#define FUNLOG \
- __FILE__ << ':' << __LINE__ << '(' << BOOST_CURRENT_FUNCTION << ')'
+ '(' << BOOST_CURRENT_FUNCTION << ')'
inline std::string objectIdFromCurrent(const Ice::Current& current)
{
diff --git a/src/SessionCollection.cpp b/src/SessionCollection.cpp
index fbe07bb..bf9db83 100644
--- a/src/SessionCollection.cpp
+++ b/src/SessionCollection.cpp
@@ -25,14 +25,6 @@ using namespace AsteriskSCF::Bridge::V1;
using namespace AsteriskSCF;
using namespace std;
-/**
- *
- * NOTE: The lack of reaping throughout is deliberate. Sessions that are in a terminal state are of some interest to the
- * service internals. Reaping is consequently a manual process. The visitSessions method + various SessionOperations can
- * be used to perform state-dependent queries.
- *
- **/
-
SessionCollection::SessionCollection(const Ice::CommunicatorPtr& comm, const string& bridgeId,
const ReplicatorSmartPrx& replicator,
const Logger& logger) :
diff --git a/src/SessionListener.cpp b/src/SessionListener.cpp
index 5fffe12..0521181 100644
--- a/src/SessionListener.cpp
+++ b/src/SessionListener.cpp
@@ -124,7 +124,7 @@ public:
{
string proxyString = source->ice_toString();
mLogger(Debug) << FUNLOG << ": session connected " << proxyString;
-
+ mSessions->reap();
try
{
SessionWrapperPtr session = mSessions->getSession(source);
@@ -195,6 +195,7 @@ public:
{
try
{
+ mSessions->reap();
SessionSeq currentSessions = mSessions->getSessionSeq();
//
diff --git a/src/Tasks.h b/src/Tasks.h
index 0b13188..c3ce557 100644
--- a/src/Tasks.h
+++ b/src/Tasks.h
@@ -235,7 +235,7 @@ public:
**/
void start()
{
- mLogger(AsteriskSCF::System::Logging::Debug) << mName << ": starting running";
+ mLogger(AsteriskSCF::System::Logging::Debug) << " " << mName << " starting running.";
{
boost::unique_lock<boost::shared_mutex> lock(mLock);
if (!mStopped)
@@ -258,7 +258,7 @@ public:
**/
void stop()
{
- mLogger(AsteriskSCF::System::Logging::Debug) << mName << ": setting stop";
+ mLogger(AsteriskSCF::System::Logging::Debug) << " " << mName << " setting stop";
boost::unique_lock<boost::shared_mutex> lock(mLock);
mStopped = true;
}
@@ -286,7 +286,7 @@ public:
QueuedTaskPtr current = popNextTask();
while (current)
{
- mLogger(AsteriskSCF::System::Logging::Debug) << ": " << mName << " executing " << current->name();
+ mLogger(AsteriskSCF::System::Logging::Debug) << " " << mName << " executing " << current->name();
//
// Properly implemented tasks will return true if the next task should
@@ -313,11 +313,11 @@ public:
**/
void failed()
{
- mLogger(AsteriskSCF::System::Logging::Debug) << ": " << mName << " entering failed state";
+ mLogger(AsteriskSCF::System::Logging::Debug) << " " << mName << " entering failed state";
QueuedTaskPtr current = popNextTask();
while (current)
{
- mLogger(AsteriskSCF::System::Logging::Debug) << ": " << mName << " failing " << current->name();
+ mLogger(AsteriskSCF::System::Logging::Debug) << " " << mName << " failing " << current->name();
current->fail();
current = popNextTask();
}
@@ -334,14 +334,14 @@ public:
**/
void destroy()
{
- mLogger(AsteriskSCF::System::Logging::Debug) << ": " << mName << " entering destroyed state";
+ mLogger(AsteriskSCF::System::Logging::Debug) << " " << mName << " entering destroyed state";
//
// NOTE: a request that is in progress will not be destroyed.
//
QueuedTaskPtr current = popNextTask();
while (current)
{
- mLogger(AsteriskSCF::System::Logging::Debug) << ": " << mName << " destroying " << current->name();
+ mLogger(AsteriskSCF::System::Logging::Debug) << " " << mName << " destroying " << current->name();
current->destroy();
current = popNextTask();
}
-----------------------------------------------------------------------
--
asterisk-scf/release/bridging.git
More information about the asterisk-scf-commits
mailing list