Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork9.7k
Display orphaned events in profiler#24392
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
nicolas-grekas commentedOct 2, 2017
The BC break should be removed, as we have a policy of not doing hard BC break: any future BC break needs to be announced with a runtime deprecation notice in 3.4. Which makes me wonder BTW: do we need TraceableEventDispatcherInterface at all? Is it really something we want ppl to be able to implement on their own? If no, then let's just deprecate it. |
stof commentedOct 2, 2017
I think we could deprecate the interface |
| // THEN | ||
| $this->assertEmpty($events); | ||
| // SCENARIO - Returns orphaned event |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
different scenarios should be different tests (so that a failure in the first oen does not prevent others from running)
mateuszsip commentedOct 2, 2017
@stof@nicolas-grekas |
nicolas-grekas commentedOct 8, 2017
Moving to 4.1. Rebase on master might be needed, where PHP 7.1 features can be used btw. |
ed8fa01 to5fdb763Comparemateuszsip commentedOct 14, 2017
Rebased, updated changelogs and |
mateuszsip commentedOct 22, 2017
@stof could you check updated code? Tests failure looks unrelated. |
| publicfunctionlateCollect() | ||
| { | ||
| if ($this->dispatcherinstanceofTraceableEventDispatcherInterface) { | ||
| if ($this->dispatcherinstanceofTraceableEventDispatcher) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
wanted? What about an additional instanceof check before callingsetOrphanedEvents.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Good question.
I went this way becauseTraceableEventDispatcherInterface gets depracted anyway.
@nicolas-grekas, what do you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Legacy code should continue to work
| privatefunctionpreProcess($eventName) | ||
| { | ||
| if (false ===$this->dispatcher->hasListeners($eventName)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
!$this->dispatcher->has...
| privatefunctionpreProcess($eventName) | ||
| { | ||
| if (false ===$this->dispatcher->hasListeners($eventName)) { | ||
| $this->orphanedEvents[] =$eventName; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
return; here
| } | ||
| /** | ||
| *Gets the called listeners. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
the diff is kinda messy... cant we avoid it by simply appending set+get (which seem to be the pattern anyway).
mateuszsip commentedOct 26, 2017
Thanks@ro0NL for review. |
ro0NL left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
LGTM 👍
| /** | ||
| * Sets the not called listeners. | ||
| * | ||
| * @param array $listeners An array of not called listeners |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
this seems useless
| /** | ||
| * Sets the orphaned events. | ||
| * | ||
| * @param array $events An array of orphaned events |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
this seems useless too
Simperfit left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
left 2 minor comments but LGTM
09a0fa1 toe18f77cComparemateuszsip commentedNov 1, 2017
rebased |
xabbuh commentedNov 7, 2017
deprecations will have to be documented in the |
e18f77c tofb16cfaComparemateuszsip commentedDec 3, 2017
Rebased, deprecations documented in |
UPGRADE-4.1.md Outdated
| UPGRADE FROM 4.0 to 4.1 | ||
| ======================= | ||
| Event Dispatcher |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
EventDispatcher (that's the name of the component :))
UPGRADE-4.1.md Outdated
| ======================= | ||
| Event Dispatcher | ||
| ----------- |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
please use as many dashes as the length of the component's name
…roduced interface deprecation
fb16cfa toe53b7f3Comparemateuszsip commentedDec 28, 2017
Thanks@xabbuh, I wasn't aware of that. Rebased and corrected. |
fabpot commentedJan 19, 2018
Thank you @kejwmen. |
This PR was squashed before being merged into the 4.1-dev branch (closessymfony#24392).Discussion----------Display orphaned events in profiler| Q | A| ------------- | ---| Branch? | 4.1| Bug fix? | no| New feature? | yes| BC breaks? | no| Deprecations? | yes| Tests pass? | yes| Fixed tickets |symfony#24347| License | MITImplementssymfony#24347.Deprecating `TraceableEventDispatcherInterface`.Commits-------509f9a9 Display orphaned events in profiler
…ont)This PR was merged into the 4.1 branch.Discussion----------[EventDispatcher] Clear orphaned events on reset| Q | A| ------------- | ---| Branch? | 4.1| Bug fix? | yes| New feature? | no| BC breaks? | no| Deprecations? | no| Tests pass? | yes| Fixed tickets | NA| License | MIT| Doc PR | NAWhen the Orphaned Events feature was added in#24392 it was forgotten to also clear them when the `reset` method on the `TraceableEventDispatcher` is called. This makes the Orphaned Events tab on the Event profiler an evergrowing list when using PHP-PM (or other event loop implementations).Commits-------d3260df [EventDispatcher] Clear orphaned events on TraceableEventDispatcher::reset
Uh oh!
There was an error while loading.Please reload this page.
Implements#24347.
Deprecating
TraceableEventDispatcherInterface.