Skip to content

[DoctrineBridge] Prevent idle connection listener from running on subrequest #61120

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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 15, 2025

Conversation

dmitryuk
Copy link
Contributor

@dmitryuk dmitryuk commented Jul 15, 2025

Q A
Branch? 7.2
Bug fix? yes
New feature? no
Deprecations? no
Issues -
License MIT

Original PR #53214 has a bug.
Story:

  • do a main request
  • begin database transaction
  • do subrequest
  • IdleTransaction closes connection in subrequest
  • continue working in main request
  • commit and get error NoActiveTransaction

@carsonbot carsonbot added this to the 7.4 milestone Jul 15, 2025
@dmitryuk dmitryuk changed the base branch from 7.4 to 7.3 July 15, 2025 06:17
@dmitryuk dmitryuk changed the title [DoctrineBridge] Prevent idle connection listener from running on sub… [DoctrineBridge] Prevent idle connection listener from running on subrequest Jul 15, 2025
@nicolas-grekas nicolas-grekas modified the milestones: 7.4, 7.3 Jul 15, 2025
@symfony symfony deleted a comment from carsonbot Jul 15, 2025
Copy link
Member

@nicolas-grekas nicolas-grekas left a comment

Choose a reason for hiding this comment

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

For 7.2 I'd say

@nicolas-grekas nicolas-grekas modified the milestones: 7.3, 7.2 Jul 15, 2025
@dmitryuk dmitryuk force-pushed the 7.3-doctrine-idle-listener-fix branch from bd72428 to d961acc Compare July 15, 2025 09:41
@dmitryuk dmitryuk changed the base branch from 7.3 to 7.2 July 15, 2025 09:42
@dmitryuk dmitryuk changed the base branch from 7.2 to 7.3 July 15, 2025 09:42
@dmitryuk
Copy link
Contributor Author

For 7.2 I'd say

Do you want to change base branch to 7.2 ?

@nicolas-grekas nicolas-grekas changed the base branch from 7.3 to 7.2 July 15, 2025 09:47
@nicolas-grekas nicolas-grekas force-pushed the 7.3-doctrine-idle-listener-fix branch from d961acc to 3d9d99a Compare July 15, 2025 09:47
@nicolas-grekas
Copy link
Member

I took care of it. Thanks @dmitryuk!

@nicolas-grekas nicolas-grekas merged commit f1e3356 into symfony:7.2 Jul 15, 2025
10 of 11 checks passed
@@ -29,6 +30,9 @@ public function __construct(

public function onKernelRequest(RequestEvent $event): void
{
if (HttpKernelInterface::MAIN_REQUEST !== $event->getRequestType()) {
Copy link
Member

Choose a reason for hiding this comment

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

We usually use isMainRequest()

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Possible, but the same logic, thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants