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

[DoctrineBridge] Fix LockStoreSchemaListener not working properly with iterable objects#54407

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
barton-webwings wants to merge4 commits intosymfony:6.4frombarton-webwings:6.4

Conversation

@barton-webwings
Copy link
Contributor

@barton-webwingsbarton-webwings commentedMar 26, 2024
edited
Loading

QA
Branch?6.4
Bug fix?yes
New feature?yes
Deprecations?no
IssuesFix#54406
LicenseMIT

Toflar reacted with heart emoji
@carsonbot
Copy link

Hey!

Thanks for your PR. You are targeting branch "6.4" but it seems your PR description refers to branch "7.1 for features / 5.4, 6.4, or 7.0 for bug fixes".
Could you update the PR description or change target branch? This helps core maintainers a lot.

Cheers!

Carsonbot

@MatTheCat
Copy link
Contributor

MatTheCat commentedMar 26, 2024
edited
Loading

I think you can simply revert#50761:

  • ArrayIterator won’t work as expected when passed a traversable (this is whytestPostGenerateSchemaWithInvalidLockStore passes: its iterator won’t yield anything. You can be sure because its generator uses$this while beingstatic).
  • Exceptions thrown inside a generator will appear when callingvalid ornext, notcurrent.
  • An exception thrown inside a generator would close it, even if caught when iterating; this could result in other stores being silently ignored.
  • LogicExceptions are not supposed to be caught.
barton-webwings reacted with thumbs up emoji

…tener` raised by `StoreFactory`"This reverts commit0acd403.
@nicolas-grekasnicolas-grekas changed the titleFix LockStoreSchemaListener not working properly with iterable objects[DoctrineBridge] Fix LockStoreSchemaListener not working properly with iterable objectsApr 11, 2024
@nicolas-grekas
Copy link
Member

/cc@alexandre-daubois FYI

alexandre-daubois reacted with thumbs up emoji

@alexandre-daubois
Copy link
Member

alexandre-daubois commentedApr 11, 2024
edited
Loading

Indeed my solution doesn't work as expected. I don't think that reverting the PR is the best solution, because it would fix a bug but reintroduce one in the codebase.

I'm on my phone right now but I can have a look at it tomorrow to find/have a look for a proper solution, if you need help 🙂

barton-webwings reacted with thumbs up emoji

@barton-webwings
Copy link
ContributorAuthor

I think there could be a better solution to the original issue#50761.

Personally, I would take a similar path to Monolog'sNullHandler or Mailer'sNullTransport and introduce aNullStore and a corresponding case to theStoreFactory. The DSN could look something likeLOCK_STORE=null://.

This way we would avoid theInvalidArgumentException, which I agree is a legitimate exception, but preserve the option to effectively disable the Lock component.

alexandre-daubois reacted with thumbs up emoji

@alexandre-daubois
Copy link
Member

Seems to be a great solution indeed, I like it!

@barton-webwings
Copy link
ContributorAuthor

barton-webwings commentedApr 12, 2024
edited
Loading

I pushed a draft of my proposed solution into this PR, hopefully I didn't miss anything.

Since theStoreFactory already has cases which are not strictly a dsn, I went with a simplenull, which would theoretically work with existing cases ofLOCK_STORE=null.

Copy link
Member

@alexandre-dauboisalexandre-daubois left a comment

Choose a reason for hiding this comment

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

Seems like a clean solution like this 😊

@nicolas-grekas
Copy link
Member

So, that's a new feature now, isn't it?

barton-webwings reacted with thumbs up emoji

@Toflar
Copy link
Contributor

Not really a new feature. The current implementation is broken. It will not add the required schema as described in#54406. Just faced the same issue and this PR fixes it :)

@MatTheCat
Copy link
Contributor

MatTheCat commentedMay 4, 2024
edited
Loading

TheNullStore is a new feature.

#50761 revert is a fix.

*
* @author Pavel Bartoň <barton@webwings.cz>
*/
class NullStoreimplements BlockingSharedLockStoreInterface
Copy link
Member

Choose a reason for hiding this comment

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

Introducing this class (as well as the changes to theStoreFactory) must be moved into a separate PR targeting the7.2 branch. That's a new feature.

$subscriber->postGenerateSchema($event);
}

publicfunctiontestPostGenerateSchemaWithInvalidLockStore()
Copy link
Member

Choose a reason for hiding this comment

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

this test should be kept as fixing the issue#50761 tried to fix is legitimate

}

$store->configureSchema($event->getSchema(),$this->getIsSameDatabaseChecker($connection));
}catch (InvalidArgumentException) {
Copy link
Member

Choose a reason for hiding this comment

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

we still need catch the exception to not reintroduce the bug that#50761 tried to fix

@MatTheCat
Copy link
Contributor

@xabbuh there was in fact no bug prior to#50761: it is normal an exception is thrown when giving theStoreFactory an invalid DSN, and it is outlined by the fact said exception extendsLogicException, which is not supposed to be caught.

@uwej711
Copy link
Contributor

OK, so where do we go from here? Keep the current bug in 6.4, revert the commit that causes the bug and having the issue it tried to fix again or something else?

@xabbuh
Copy link
Member

I would be okay with both solutions. Either reverting#50671 or switching toforeach). But the newnull schema cannot be merged into 6.4 and must be moved into a PR targeting 7.2.

@barton-webwings
Copy link
ContributorAuthor

I am closing this PR, as it is superseded by#57944.
I am actually only interested in the bugfix part of this issue, so we can remove the workaround after update.
If someone wants to make a PR for the new feature introduced, feel free.

nicolas-grekas added a commit that referenced this pull requestAug 13, 2024
…Cat)This PR was squashed before being merged into the 6.4 branch.Discussion----------[DoctrineBridge] Fix the `LockStoreSchemaListener`| Q             | A| ------------- | ---| Branch?       | 6.4| Bug fix?      | yes| New feature?  | no| Deprecations? | no| Issues        |Fix#54406| License       | MIT#54407 got sidetracked ~and `@barton`-webwings seems no longer active on GitHub~ so this PR takes over.Commits-------db070a1 [DoctrineBridge] Fix the `LockStoreSchemaListener`
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@xabbuhxabbuhxabbuh requested changes

@alexandre-dauboisalexandre-dauboisalexandre-daubois approved these changes

@jderussejderusseAwaiting requested review from jderussejderusse is a code owner

Assignees

No one assigned

Projects

None yet

Milestone

6.4

Development

Successfully merging this pull request may close these issues.

8 participants

@barton-webwings@carsonbot@MatTheCat@nicolas-grekas@alexandre-daubois@Toflar@uwej711@xabbuh

[8]ページ先頭

©2009-2025 Movatter.jp