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

[EventDispatcher] Split events across requests#29312

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

Merged
fabpot merged 1 commit intosymfony:masterfromro0NL:split-event
Apr 2, 2019
Merged

[EventDispatcher] Split events across requests#29312

fabpot merged 1 commit intosymfony:masterfromro0NL:split-event
Apr 2, 2019

Conversation

@ro0NL
Copy link
Contributor

@ro0NLro0NL commentedNov 25, 2018
edited
Loading

QA
Branch?master
Bug fix?no
New feature?yes
BC breaks?no
Deprecations?no
Tests pass?yes
Fixed tickets#24275
LicenseMIT
Doc PRsymfony/symfony-docs#...

Split events per request, as currently a profiled sub-request includes all events. Follows same approach how logs are split in#23659.

Copy link
ContributorAuthor

@ro0NLro0NL left a comment
edited
Loading

Choose a reason for hiding this comment

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

now called listeners fixed. It's definitely better from the profiler pov.

The UI solves itself btw :) great.

(main request)

image

(sub request)

image

}

$this->called[$eventName]->attach($listener);
$this->callStack->attach($listener,array($eventName,$this->currentRequestHash));
Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

same issue with keys; grouping by event name breaks the dispatch order

@nicolas-grekasnicolas-grekas added this to thenext milestoneNov 25, 2018
@ro0NL
Copy link
ContributorAuthor

Last but not least, i think we should append eachwrapped listener to the call stack duringpre process and lazy verify if it was called yes/no.

Currently it's added to the call stack during post-process which affects the order. I.e. the main kernel.exception is called before the sub kernel.reques, but we only collect that after the sub request finished.

@ro0NL
Copy link
ContributorAuthor

Ive updated above screenshots afterc737944

@ro0NLro0NL changed the title[EventDispatcher][WIP] Split events across requests[EventDispatcher] Split events across requestsNov 25, 2018
nicolas-grekas added a commit that referenced this pull requestDec 1, 2018
This PR was merged into the 4.1 branch.Discussion----------[WebProfilerBundle] Fix title case| Q             | A| ------------- | ---| Branch?       | 4.1| Bug fix?      | yes| New feature?  | no| BC breaks?    | no     <!-- seehttps://symfony.com/bc -->| Deprecations? | no| Tests pass?   | yes    <!-- please add some, will be required by reviewers -->| Fixed tickets | #...   <!-- #-prefixed issue number(s), if any -->| License       | MIT| Doc PR        | symfony/symfony-docs#... <!-- required for new features -->Split from#29312 for 4.1 👼Commits-------3e16e25 [WebProfilerBundle] Fix title case
nicolas-grekas added a commit that referenced this pull requestDec 17, 2018
This PR was merged into the 3.4 branch.Discussion----------[EventDispatcher] Revers event tracing order| Q             | A| ------------- | ---| Branch?       | 3.4| Bug fix?      | yes| New feature?  | no| BC breaks?    | no     <!-- seehttps://symfony.com/bc -->| Deprecations? | no| Tests pass?   | yes    <!-- please add some, will be required by reviewers -->| Fixed tickets | #...   <!-- #-prefixed issue number(s), if any -->| License       | MIT| Doc PR        | symfony/symfony-docs#... <!-- required for new features -->Split from#29312 for 3.4This traces events in dispatch order.Before:![image](https://user-images.githubusercontent.com/1047696/49330956-5f71e780-f596-11e8-8701-80458e715213.png)After:![image](https://user-images.githubusercontent.com/1047696/49330963-79abc580-f596-11e8-8666-5535afd59b31.png)Here we see it also collects "terminate" events (both kernel & console for not-called listeners). In case of exception page the fix is even better:#29312 (review)Which now correctly shows the kernel.exception event of the main request is dispatched _before_ the kernel.request event of the sub-request.Moreover, it de-duplicates events. So we actually see the sub-request events 🎉_Havent looked at tests yet._Commits-------2570d6f [EventDispatcher] Revers event tracing order
symfony-splitter pushed a commit to symfony/event-dispatcher that referenced this pull requestDec 17, 2018
This PR was merged into the 3.4 branch.Discussion----------[EventDispatcher] Revers event tracing order| Q             | A| ------------- | ---| Branch?       | 3.4| Bug fix?      | yes| New feature?  | no| BC breaks?    | no     <!-- seehttps://symfony.com/bc -->| Deprecations? | no| Tests pass?   | yes    <!-- please add some, will be required by reviewers -->| Fixed tickets | #...   <!-- #-prefixed issue number(s), if any -->| License       | MIT| Doc PR        | symfony/symfony-docs#... <!-- required for new features -->Split from #29312 for 3.4This traces events in dispatch order.Before:![image](https://user-images.githubusercontent.com/1047696/49330956-5f71e780-f596-11e8-8701-80458e715213.png)After:![image](https://user-images.githubusercontent.com/1047696/49330963-79abc580-f596-11e8-8666-5535afd59b31.png)Here we see it also collects "terminate" events (both kernel & console for not-called listeners). In case of exception page the fix is even better:symfony/symfony#29312 (review)Which now correctly shows the kernel.exception event of the main request is dispatched _before_ the kernel.request event of the sub-request.Moreover, it de-duplicates events. So we actually see the sub-request events 🎉_Havent looked at tests yet._Commits-------2570d6f877 [EventDispatcher] Revers event tracing order
Copy link
Member

@nicolas-grekasnicolas-grekas left a comment

Choose a reason for hiding this comment

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

What about making the class@final? (if you agree, don't forget updating the changelog file)

  • rebase needed btw

@fabpot
Copy link
Member

@ro0NL Do you think you can finish this one for 4.3?

@ro0NL
Copy link
ContributorAuthor

@fabpot done.

@fabpot
Copy link
Member

@ro0NL Apparently, tests do not pass. Can you have a look please?

@ro0NL
Copy link
ContributorAuthor

Let's see now :) i think it's a shortcoming of sf/debug not accounting for@inheritdoc :/

@nicolas-grekas
Copy link
Member

I think it's a shortcoming of sf/debug not accounting for@inheritdoc :/

It's not a bug it's a feature. You must have to change your code when a lower layer decides to deprecate something. This is how.

ro0NL reacted with thumbs up emoji

@fabpot
Copy link
Member

Thank you@ro0NL.

@fabpotfabpot merged commitc3477ba intosymfony:masterApr 2, 2019
fabpot added a commit that referenced this pull requestApr 2, 2019
This PR was squashed before being merged into the 4.3-dev branch (closes#29312).Discussion----------[EventDispatcher] Split events across requests| Q             | A| ------------- | ---| Branch?       | master| Bug fix?      | no| New feature?  | yes| BC breaks?    | no     <!-- seehttps://symfony.com/bc -->| Deprecations? | no| Tests pass?   | yes    <!-- please add some, will be required by reviewers -->| Fixed tickets |#24275| License       | MIT| Doc PR        | symfony/symfony-docs#... <!-- required for new features -->Split events per request, as currently a profiled sub-request includes all events. Follows same approach how logs are split in#23659.Commits-------c3477ba [EventDispatcher] Split events across requests
@ro0NLro0NL deleted the split-event branchApril 2, 2019 10:08
@nicolas-grekasnicolas-grekas modified the milestones:next,4.3Apr 30, 2019
@fabpotfabpot mentioned this pull requestMay 9, 2019
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

@fabpotfabpotfabpot approved these changes

Assignees

No one assigned

Projects

None yet

Milestone

4.3

Development

Successfully merging this pull request may close these issues.

4 participants

@ro0NL@fabpot@nicolas-grekas@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp