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

[Messenger] FixTraceableMessageBus implementation so it can compute caller even when used within a callback#43781

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

Conversation

@Ocramius
Copy link
Contributor

QA
Branch?4.4
Bug fix?yes
New feature?no
Deprecations?no
Tickets
LicenseMIT
Doc PR

Quoting commits:

This test shows that `array_map([new TraceableMessageBus(...), 'dispatch'], $messages)` does not work at all,because `debug_backtrace()` is used in internals to compute the call-site, and it is not considering the factthat the caller may be: * an internal PHP function * a callback (this example test scenario) * generated code (`eval()` result)The output of such a failure:```1) Symfony\Component\Messenger\Tests\TraceableMessageBusTest::testItTracesExceptionsWhenMessageBusIsFiredFromArrayCallbackUndefined array key "line"/app/src/Symfony/Component/Messenger/TraceableMessageBus.php:66/app/src/Symfony/Component/Messenger/TraceableMessageBus.php:36/app/src/Symfony/Component/Messenger/Tests/TraceableMessageBusTest.php:175```To be on the safe side, also removed `compact()` usage, which was making everythingmuch muddier and harder to comprehend.

Copy link
Member

@derrabusderrabus left a comment

Choose a reason for hiding this comment

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

Thank you. LGTM, once the two issues fabbot found have been fixed.

@carsonbotcarsonbot changed the titleFixTraceableMessageBus implementation so it can compute caller even when used within a callback[Messenger] FixTraceableMessageBus implementation so it can compute caller even when used within a callbackOct 27, 2021
@OcramiusOcramiusforce-pushed thefix/correct-backtrace-assumptions-in-traceable-message-bus-debug-backtrace branch fromde2d2c3 tof534166CompareOctober 27, 2021 14:52
@Ocramius
Copy link
ContributorAuthor

@derrabus all good according to automation now.

@nicolas-grekasnicolas-grekasforce-pushed thefix/correct-backtrace-assumptions-in-traceable-message-bus-debug-backtrace branch fromf534166 to1423229CompareOctober 27, 2021 16:01
@nicolas-grekas
Copy link
Member

Thank you@Ocramius.

@nicolas-grekasnicolas-grekas merged commit36f8fe5 intosymfony:4.4Oct 27, 2021
@OcramiusOcramius deleted the fix/correct-backtrace-assumptions-in-traceable-message-bus-debug-backtrace branchOctober 27, 2021 19:22
This was referencedOct 29, 2021
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@derrabusderrabusderrabus approved these changes

@chalasrchalasrchalasr approved these changes

@srozesrozeAwaiting requested review from sroze

Assignees

No one assigned

Projects

None yet

Milestone

4.4

Development

Successfully merging this pull request may close these issues.

5 participants

@Ocramius@nicolas-grekas@derrabus@chalasr@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp