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

Upgrade mutex #297

Closed
wants to merge 2 commits into from
Closed

Upgrade mutex #297

wants to merge 2 commits into from

Conversation

sembrestels
Copy link

No description provided.

@sembrestels
Copy link
Author

What do you think about this solution?

We can copy the script in upgrade.php directly, because I don't feel necessary an elgg_ftok function.

@cash
Copy link
Contributor

cash commented Jul 7, 2012

We could create a ElggMutex class and implement what you have in there. The class would check if the server is running Windows and not use the semaphore for Windows. Windows sites would just have to be careful during upgrade.

To make this work on sites with multiple servers, we are going to have to move the mutex into the database. This is starting to sound complicated.

@sembrestels
Copy link
Author

I have another branch implementing mutex with files. It isn't working, but we can try to do the same with the database.

@cash
Copy link
Contributor

cash commented Jul 8, 2012

I changed my mind. I don't think adding an ElggMutex class is a good idea. Instead, we should create an ElggUpgrader class like I did for the installer. I will add comments about files vs database vs shared memory soon.

@sembrestels
Copy link
Author

I also think that a ElggMutex will be underused. Can you connect to chat and we talk about it?

@sembrestels
Copy link
Author

I don't understand what do you mean in move the mutex into database. Is this do not use php semaphores and use the atomicity of the database to implement them?

@cash
Copy link
Contributor

cash commented Jul 8, 2012

Sem and I talked in IRC. We think creating/dropping a table can be used as a mutex. It will be database independent (mysql vs postgres) and work on sites that use multiple servers.

@sembrestels
Copy link
Author

It is here: #309

I run three times the script, opening at the same time, and it makes them one per one. It isn't the hoped behavior, the second and third script should stop...

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

Successfully merging this pull request may close these issues.

None yet

2 participants