Skip to content

Commit

Permalink
Fixed #7295: Unexpected message 'Error reading data from the connecti…
Browse files Browse the repository at this point in the history
…on' when fbtracemgr is closed using ctrl-C

(cherry picked from commit b7d42e2)
  • Loading branch information
AlexPeshkoff committed Sep 12, 2022
1 parent 852e8e9 commit 1e3e881
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions src/utilities/fbtracemgr/traceMgrMain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@ class TraceSvcUtil : public TraceSvcIntf
virtual void setActive(ULONG id, bool active);
virtual void listSessions();

os_utils::CtrlCHandler ctrlCHandler;

private:
void runService(size_t spbSize, const UCHAR* spb);

Expand Down Expand Up @@ -202,8 +204,6 @@ void TraceSvcUtil::listSessions()

void TraceSvcUtil::runService(size_t spbSize, const UCHAR* spb)
{
os_utils::CtrlCHandler ctrlCHandler;

ISC_STATUS_ARRAY status;

if (isc_service_start(status, &m_svcHandle, 0,
Expand Down Expand Up @@ -324,20 +324,23 @@ int CLIB_ROUTINE main(int argc, char* argv[])
fb_utils::FbShutdown appShutdown(fb_shutrsn_app_stopped);

AutoPtr<UtilSvc> uSvc(UtilSvc::createStandalone(argc, argv));
TraceSvcUtil traceUtil;

try
{
TraceSvcUtil traceUtil;

fbtrace(uSvc, &traceUtil);
}
catch (const Firebird::Exception& ex)
{
Firebird::StaticStatusVector temp;
if (!traceUtil.ctrlCHandler.getTerminated())
{
Firebird::StaticStatusVector temp;

ex.stuffException(temp);
isc_print_status(temp.begin());
ex.stuffException(temp);
isc_print_status(temp.begin());

return FINI_ERROR;
return FINI_ERROR;
}
}

return FINI_OK;
Expand Down

0 comments on commit 1e3e881

Please sign in to comment.