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

craft\helpers\App\mutexConfig is deprecated but craft\helpers\App\dbMutexConfig breaks with isWindows option #7242

Closed
jamesmacwhite opened this issue Dec 10, 2020 · 7 comments
Labels

Comments

@jamesmacwhite
Copy link
Contributor

Description

I have handling for a local development environment because it is a Windows host, with the Mutex config described here: #4355

In Craft 3.5 is appears mutexConfig is deprecated and should be dbMutexConfig, however, applying this causing the following error:

Exception 'yii\base\UnknownPropertyException' with message 'Setting unknown property: yii\mutex\MysqlMutex::isWindows'

The isWindows option exists in the FileMutex, not MySQL mutex. Does the Windows FS mutex config need a slight refactor for 3.5 to avoid the deprecation error?

image

Additional info

  • Craft version: 3.5.16
  • PHP version: 7.3
  • Database driver & version: MySQL 5.7
@brandonkelly
Copy link
Member

The DB mutex classes don’t care whether it’s a Windows file system or not – which is one of the reasons we’ve deprecated the file-based one.

You can safely delete that whole function now.

@jamesmacwhite
Copy link
Contributor Author

jamesmacwhite commented Dec 10, 2020

@brandonkelly Thank you for clarifying. So isWindows isn't needed anymore in 3.5+?

I'm just thinking the file mutex is still likely going to benefit from being told it's a Windows file system: https://www.yiiframework.com/doc/api/2.0/yii-mutex-filemutex

Given various commands can fail because unix-like commands will try to be executed on a Windows FS and it ends up in a bad time, I remember it back in 2019.

@brandonkelly
Copy link
Member

So isWindows isn't needed anymore in 3.5+?

Not if you’re going with the now-default DB-based mutex driver.

I'm just thinking the file mutex is still likely going to benefit from being told it's a Windows file system: https://www.yiiframework.com/doc/api/2.0/yii-mutex-filemutex

That’s the file-based driver.

@jamesmacwhite
Copy link
Contributor Author

Thanks! Makes sense. I'll test with the DB driver.

Perhaps the docs might need an update for Craft 3.5 where the file mutex isWindows option is mentioned at some point.

@brandonkelly
Copy link
Member

I just improved the docblock for craft\helpers\App::mutexConfig(), for the next release.

@jamesmacwhite
Copy link
Contributor Author

Thank you! That will be useful to others. Just as an additional note Craft Nitro has a direct reference to the older file mutex here: https://craftcms.com/docs/nitro/usage.html#adding-sites

Might be worth having a Craft 3.5+ specific note at some point.

@brandonkelly
Copy link
Member

Doh, thanks for pointing that out! Just went ahead and removed the tip.

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

No branches or pull requests

2 participants