Skip to content
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

Avoid errors when trying to lock config if database is not yet available #4603

Merged
merged 1 commit into from
Feb 6, 2025

Conversation

colinmollenhour
Copy link
Member

I'm not sure exactly why this occurs but without it I get an error during installation. Chicken/egg scenario I think but seems sane to not throw any errors if there is no database connection so that a database connection is not required just to init the config..

image

@github-actions github-actions bot added Component: Core Relates to Mage_Core Template : rwd Relates to rwd template labels Feb 5, 2025
@github-actions github-actions bot removed the Template : rwd Relates to rwd template label Feb 5, 2025
Copy link

sonarqubecloud bot commented Feb 5, 2025

@sreichel
Copy link
Contributor

sreichel commented Feb 6, 2025

Is it usefull to log an exception?

@colinmollenhour
Copy link
Member Author

Is it usefull to log an exception?

I don't think so, if there is an issue with getting the core connection, then I'm sure there will be many other errors logged as well. :) Using locking while loading the config is not absolutely critical, so if it fails during fresh installation, then there is no concern.

@sreichel
Copy link
Contributor

sreichel commented Feb 6, 2025

I'm sure there will be many other errors logged as well.

It sould not? Calling a method on bool could not happen silently. Atm it would only log your error - or am i wrong?

@colinmollenhour
Copy link
Member Author

I meant that if Mage::getSingleton('core/resource')->getConnection('core_write') returns false, that will certainly cause a fatal error elsewhere.

@sreichel
Copy link
Contributor

sreichel commented Feb 6, 2025

Chicken/egg ... :)

@sreichel sreichel added the bug label Feb 6, 2025
@sreichel sreichel merged commit 7e5a141 into OpenMage:main Feb 6, 2025
17 checks passed
fballiano added a commit to MahoCommerce/maho that referenced this pull request Feb 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Component: Core Relates to Mage_Core
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants