Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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

Closed

Conversation

@mateuszsip
Copy link
Contributor

@mateuszsipmateuszsip commentedOct 1, 2017
edited
Loading

QA
Branch?4.1
Bug fix?no
New feature?yes
BC breaks?no
Deprecations?yes
Tests pass?yes
Fixed tickets#24347
LicenseMIT

Implements#24347.

DeprecatingTraceableEventDispatcherInterface.

@nicolas-grekas
Copy link
Member

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.
So, the addition to the interface must be reverted, and another way should be found.

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.

@nicolas-grekasnicolas-grekas added this to the3.4 milestoneOct 2, 2017
@stof
Copy link
Member

stof commentedOct 2, 2017

I think we could deprecate the interface

// THEN
$this->assertEmpty($events);

// SCENARIO - Returns orphaned event
Copy link
Member

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 reacted with thumbs up emoji
@mateuszsip
Copy link
ContributorAuthor

@stof@nicolas-grekas
DeprecatedTraceableEventDispatcherInterface.

@nicolas-grekas
Copy link
Member

Moving to 4.1. Rebase on master might be needed, where PHP 7.1 features can be used btw.

@nicolas-grekasnicolas-grekas modified the milestones:3.4,4.1Oct 8, 2017
@mateuszsip
Copy link
ContributorAuthor

Rebased, updated changelogs andTraceableEventDispatcherInterface deprecation notice with new target version.

@mateuszsip
Copy link
ContributorAuthor

@stof could you check updated code?

Tests failure looks unrelated.

publicfunctionlateCollect()
{
if ($this->dispatcherinstanceofTraceableEventDispatcherInterface) {
if ($this->dispatcherinstanceofTraceableEventDispatcher) {
Copy link
Contributor

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.

Copy link
ContributorAuthor

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?

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

mateuszsip reacted with thumbs up emoji

privatefunctionpreProcess($eventName)
{
if (false ===$this->dispatcher->hasListeners($eventName)) {
Copy link
Contributor

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;
Copy link
Contributor

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.
Copy link
Contributor

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
Copy link
ContributorAuthor

Thanks@ro0NL for review.
Fixed everything you catched, including separateTraceableEventDispatcher check to not break code relying onTraceableEventDispatcherInterface.

Copy link
Contributor

@ro0NLro0NL left a 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
Copy link
Contributor

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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

this seems useless too

Copy link
Contributor

@SimperfitSimperfit left a 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

@mateuszsip
Copy link
ContributorAuthor

rebased

@xabbuh
Copy link
Member

deprecations will have to be documented in theUPGRADE-4.1.md andUPGRADE-5.0.md(to be created) files

@mateuszsip
Copy link
ContributorAuthor

Rebased, deprecations documented inUPGRADE.

UPGRADE FROM 4.0 to 4.1
=======================

Event Dispatcher
Copy link
Member

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 :))

=======================

Event Dispatcher
-----------
Copy link
Member

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

@mateuszsip
Copy link
ContributorAuthor

Thanks@xabbuh, I wasn't aware of that.

Rebased and corrected.

@fabpot
Copy link
Member

Thank you @kejwmen.

ostrolucky pushed a commit to ostrolucky/symfony that referenced this pull requestMar 25, 2018
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
@fabpotfabpot mentioned this pull requestMay 7, 2018
fabpot added a commit that referenced this pull requestJul 12, 2018
…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
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@nicolas-grekasnicolas-grekasnicolas-grekas left review comments

@stofstofstof requested changes

@fabpotfabpotfabpot approved these changes

@xabbuhxabbuhxabbuh approved these changes

+2 more reviewers

@ro0NLro0NLro0NL approved these changes

@SimperfitSimperfitSimperfit approved these changes

Reviewers whose approvals may not affect merge requirements

Assignees

No one assigned

Projects

None yet

Milestone

4.1

Development

Successfully merging this pull request may close these issues.

8 participants

@mateuszsip@nicolas-grekas@stof@xabbuh@fabpot@ro0NL@Simperfit@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp