Skip to content

add first previous exception in error detected exception for better stack trace#779

Merged
DavidBadura merged 1 commit into
3.12.xfrom
improve-error-detected-exception
Sep 19, 2025
Merged

add first previous exception in error detected exception for better stack trace#779
DavidBadura merged 1 commit into
3.12.xfrom
improve-error-detected-exception

Conversation

@DavidBadura

@DavidBadura DavidBadura commented Sep 16, 2025

Copy link
Copy Markdown
Member

No description provided.

@DavidBadura DavidBadura changed the title add first previos exception in error detected exception for better de… add first previos exception in error detected exception for better debugging Sep 16, 2025
@DavidBadura
DavidBadura removed the request for review from Copilot September 16, 2025 20:30
@github-actions

github-actions Bot commented Sep 16, 2025

Copy link
Copy Markdown

Hello 👋

here is the most recent benchmark result:

SplitStreamBench
================

+-------------------------+--------------------+--------------------+-----------+-----------------+------------+-------------+
|                         | time (kde mode)                                     | memory                                     |
+-------------------------+--------------------+--------------------+-----------+-----------------+------------+-------------+
| subject                 | Tag: <current>     | Tag: base          | time-diff | Tag: <current>  | Tag: base  | memory-diff |
+-------------------------+--------------------+--------------------+-----------+-----------------+------------+-------------+
| benchLoad10000Events () | 5.122ms (±0.00%)   | 4.962ms (±0.00%)   | +3.24%    | 34.892mb        | 35.428mb   | -1.51%      |
| benchSave10000Events () | 330.574ms (±0.00%) | 344.413ms (±0.00%) | -4.02%    | 34.960mb        | 35.495mb   | -1.51%      |
+-------------------------+--------------------+--------------------+-----------+-----------------+------------+-------------+

SimpleSetupBench
================

+----------------------------------------+--------------------+--------------------+-----------+-----------------+------------+-------------+
|                                        | time (kde mode)                                     | memory                                     |
+----------------------------------------+--------------------+--------------------+-----------+-----------------+------------+-------------+
| subject                                | Tag: <current>     | Tag: base          | time-diff | Tag: <current>  | Tag: base  | memory-diff |
+----------------------------------------+--------------------+--------------------+-----------+-----------------+------------+-------------+
| benchLoad1Event ()                     | 1.103ms (±0.00%)   | 1.114ms (±0.00%)   | -1.03%    | 34.385mb        | 34.385mb   | 0.00%       |
| benchLoad10000Events ()                | 51.718ms (±0.00%)  | 50.885ms (±0.00%)  | +1.64%    | 34.385mb        | 34.385mb   | 0.00%       |
| benchSave1Event ()                     | 1.165ms (±0.00%)   | 1.197ms (±0.00%)   | -2.67%    | 34.385mb        | 34.385mb   | 0.00%       |
| benchSave10000Events ()                | 214.124ms (±0.00%) | 215.306ms (±0.00%) | -0.55%    | 34.385mb        | 34.385mb   | 0.00%       |
| benchSave10000Aggregates ()            | 7.702s (±0.00%)    | 7.934s (±0.00%)    | -2.93%    | 34.385mb        | 34.385mb   | 0.00%       |
| benchSave10000AggregatesTransaction () | 4.916s (±0.00%)    | 4.881s (±0.00%)    | +0.72%    | 34.385mb        | 34.385mb   | 0.00%       |
+----------------------------------------+--------------------+--------------------+-----------+-----------------+------------+-------------+

PersonalDataBench
=================

+----------------------------------------+--------------------+--------------------+-----------+-----------------+------------+-------------+
|                                        | time (kde mode)                                     | memory                                     |
+----------------------------------------+--------------------+--------------------+-----------+-----------------+------------+-------------+
| subject                                | Tag: <current>     | Tag: base          | time-diff | Tag: <current>  | Tag: base  | memory-diff |
+----------------------------------------+--------------------+--------------------+-----------+-----------------+------------+-------------+
| benchLoad1Event ()                     | 1.094ms (±0.00%)   | 1.079ms (±0.00%)   | +1.38%    | 35.580mb        | 35.580mb   | 0.00%       |
| benchLoad10000Events ()                | 94.503ms (±0.00%)  | 93.699ms (±0.00%)  | +0.86%    | 35.580mb        | 35.580mb   | 0.00%       |
| benchSave1Event ()                     | 1.740ms (±0.00%)   | 1.797ms (±0.00%)   | -3.20%    | 35.580mb        | 35.580mb   | 0.00%       |
| benchSave10000Events ()                | 251.085ms (±0.00%) | 247.409ms (±0.00%) | +1.49%    | 35.581mb        | 35.581mb   | 0.00%       |
| benchSave10000Aggregates ()            | 11.876s (±0.00%)   | 11.753s (±0.00%)   | +1.04%    | 35.580mb        | 35.580mb   | 0.00%       |
| benchSave10000AggregatesTransaction () | 9.072s (±0.00%)    | 9.067s (±0.00%)    | +0.06%    | 36.039mb        | 36.039mb   | 0.00%       |
+----------------------------------------+--------------------+--------------------+-----------+-----------------+------------+-------------+

SubscriptionEngineBench
=======================

+---------------------------+-----------------+-----------------+-----------+-----------------+------------+-------------+
|                           | time (kde mode)                               | memory                                     |
+---------------------------+-----------------+-----------------+-----------+-----------------+------------+-------------+
| subject                   | Tag: <current>  | Tag: base       | time-diff | Tag: <current>  | Tag: base  | memory-diff |
+---------------------------+-----------------+-----------------+-----------+-----------------+------------+-------------+
| benchHandle10000Events () | 3.206s (±0.00%) | 3.178s (±0.00%) | +0.90%    | 47.078mb        | 47.078mb   | 0.00%       |
+---------------------------+-----------------+-----------------+-----------+-----------------+------------+-------------+

SimpleSetupStreamStoreBench
===========================

+----------------------------------------+--------------------+--------------------+-----------+-----------------+------------+-------------+
|                                        | time (kde mode)                                     | memory                                     |
+----------------------------------------+--------------------+--------------------+-----------+-----------------+------------+-------------+
| subject                                | Tag: <current>     | Tag: base          | time-diff | Tag: <current>  | Tag: base  | memory-diff |
+----------------------------------------+--------------------+--------------------+-----------+-----------------+------------+-------------+
| benchLoad1Event ()                     | 1.052ms (±0.00%)   | 1.057ms (±0.00%)   | -0.44%    | 34.568mb        | 34.568mb   | 0.00%       |
| benchLoad10000Events ()                | 59.328ms (±0.00%)  | 55.976ms (±0.00%)  | +5.99%    | 34.568mb        | 34.568mb   | 0.00%       |
| benchSave1Event ()                     | 1.512ms (±0.00%)   | 1.168ms (±0.00%)   | +29.49%   | 34.568mb        | 34.568mb   | 0.00%       |
| benchSave10000Events ()                | 278.273ms (±0.00%) | 279.595ms (±0.00%) | -0.47%    | 34.568mb        | 34.568mb   | 0.00%       |
| benchSave10000Aggregates ()            | 7.938s (±0.00%)    | 7.985s (±0.00%)    | -0.60%    | 34.568mb        | 34.568mb   | 0.00%       |
| benchSave10000AggregatesTransaction () | 5.087s (±0.00%)    | 5.059s (±0.00%)    | +0.54%    | 34.568mb        | 34.568mb   | 0.00%       |
+----------------------------------------+--------------------+--------------------+-----------+-----------------+------------+-------------+

SnapshotsBench
==============

+----------------------------------------+-------------------+-------------------+-----------+-----------------+------------+-------------+
|                                        | time (kde mode)                                   | memory                                     |
+----------------------------------------+-------------------+-------------------+-----------+-----------------+------------+-------------+
| subject                                | Tag: <current>    | Tag: base         | time-diff | Tag: <current>  | Tag: base  | memory-diff |
+----------------------------------------+-------------------+-------------------+-----------+-----------------+------------+-------------+
| benchLoad10000EventsMissingSnapshot () | 51.427ms (±0.00%) | 50.760ms (±0.00%) | +1.31%    | 34.389mb        | 34.389mb   | 0.00%       |
| benchLoad10000Events ()                | 1.118ms (±0.00%)  | 1.110ms (±0.00%)  | +0.76%    | 34.389mb        | 34.389mb   | 0.00%       |
+----------------------------------------+-------------------+-------------------+-----------+-----------------+------------+-------------+

SubscriptionEngineBatchBench
============================

+---------------------------+-------------------+-------------------+-----------+-----------------+------------+-------------+
|                           | time (kde mode)                                   | memory                                     |
+---------------------------+-------------------+-------------------+-----------+-----------------+------------+-------------+
| subject                   | Tag: <current>    | Tag: base         | time-diff | Tag: <current>  | Tag: base  | memory-diff |
+---------------------------+-------------------+-------------------+-----------+-----------------+------------+-------------+
| benchHandle10000Events () | 77.640ms (±0.00%) | 78.022ms (±0.00%) | -0.49%    | 34.849mb        | 34.849mb   | 0.00%       |
+---------------------------+-------------------+-------------------+-----------+-----------------+------------+-------------+

This comment gets update everytime a new commit comes in!

@DanielBadura

Copy link
Copy Markdown
Member

Hm I'm not sure why this would improve debugging as we are loosing information here?

@DavidBadura

DavidBadura commented Sep 19, 2025

Copy link
Copy Markdown
Member Author

We are not losing any information here. All information is still present in the exception. What has been improved here is the stack trace, which previously ended with this exception because no previous exception was used. Instead, all exception messages were displayed, but they often were not helpful because it was unclear where they came from exactly. And instead of showing all messages with little information, the first one is displayed with maximum information.

Before:

Patchlevel\EventSourcing\Subscription\Engine\ErrorDetected: Error in subscription engine detected.
Subscription push: Failed to send an update.

Stack trace Ended

After:

Patchlevel\EventSourcing\Subscription\Engine\ErrorDetected: 1 error(s) in subscription engine detected. First error is in "push" subscription: Failed to send an update.

+ Stack trace of first exception

Comment thread src/Subscription/Engine/ErrorDetected.php Outdated
@DavidBadura DavidBadura added this to the 3.12.1 milestone Sep 19, 2025
@DavidBadura DavidBadura changed the title add first previos exception in error detected exception for better debugging add first previous exception in error detected exception for better debugging Sep 19, 2025
@DavidBadura DavidBadura changed the title add first previous exception in error detected exception for better debugging add first previous exception in error detected exception for better stack trace Sep 19, 2025
@DavidBadura
DavidBadura force-pushed the improve-error-detected-exception branch from 4195e20 to 2a355ef Compare September 19, 2025 10:49
@DavidBadura
DavidBadura force-pushed the improve-error-detected-exception branch from 2a355ef to 6551d3c Compare September 19, 2025 10:51
@DavidBadura
DavidBadura merged commit f096402 into 3.12.x Sep 19, 2025
40 checks passed
@DavidBadura
DavidBadura deleted the improve-error-detected-exception branch September 19, 2025 10:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants