Skip to content

Commit 49382fb

Browse files
committed
Fix activity lifecycle: record metrics on error path, prevent stale recording
TraceCommandException now records metrics immediately and resets _startedAtTicks so the later TraceCommandStop (called during Release) does not record a second, inflated duration that includes cleanup time.
1 parent ecdb4cd commit 49382fb

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

  • src/FirebirdSql.Data.FirebirdClient/FirebirdClient

src/FirebirdSql.Data.FirebirdClient/FirebirdClient/FbCommand.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1343,6 +1343,9 @@ private void TraceCommandException(Exception e)
13431343
FbActivitySource.CommandException(_currentActivity, e);
13441344
_currentActivity = null;
13451345
}
1346+
1347+
FbMetricsStore.CommandStop(_startedAtTicks, Connection);
1348+
_startedAtTicks = 0;
13461349
}
13471350

13481351
#endregion Tracing

0 commit comments

Comments
 (0)