Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve server logging on subscription failures. #33372

Merged
merged 2 commits into from
May 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions src/app/ReadHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,16 @@ void ReadHandler::Close(CloseOptions options)
}
}
#endif // CHIP_CONFIG_PERSIST_SUBSCRIPTIONS

#if CHIP_PROGRESS_LOGGING
if (IsType(InteractionType::Subscribe))
{
const ScopedNodeId & peer = mSessionHandle ? mSessionHandle->GetPeer() : ScopedNodeId();
ChipLogProgress(DataManagement, "Subscription id 0x%" PRIx32 " from node " ChipLogFormatScopedNodeId " torn down",
mSubscriptionId, ChipLogValueScopedNodeId(peer));
}
#endif // CHIP_PROGRESS_LOGGING

MoveToState(HandlerState::AwaitingDestruction);
mManagementCallback.OnDone(*this);
}
Expand Down
7 changes: 6 additions & 1 deletion src/messaging/ExchangeMgr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,13 @@ ExchangeContext * ExchangeManager::NewContext(const SessionHandle & session, Exc
{
if (!session->IsActiveSession())
{
#if CHIP_ERROR_LOGGING
const ScopedNodeId & peer = session->GetPeer();
ChipLogError(ExchangeManager, "NewContext failed: session %u to " ChipLogFormatScopedNodeId " is inactive",
session->SessionIdForLogging(), ChipLogValueScopedNodeId(peer));
#endif // CHIP_ERROR_LOGGING

// Disallow creating exchange on an inactive session
ChipLogError(ExchangeManager, "NewContext failed: session inactive");
return nullptr;
}
return mContextPool.CreateObject(this, mNextExchangeId++, session, isInitiator, delegate);
Expand Down
Loading