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

refactor: DB Updates will now file level lock to stop duplicate updates #6469

Merged
merged 5 commits into from May 3, 2017

Conversation

Projects
None yet
5 participants
@laf
Member

laf commented Apr 19, 2017

DO NOT DELETE THIS TEXT

Please note

Please read this information carefully. You can run ./scripts/pre-commit.php to check your code before submitting.

  • Have you signed the Contributors agreement - please do NOT submit a pull request unless you have (signing the agreement in the same pull request is fine). Your commit message for signing the agreement must appear as per the docs.
  • Have you followed our code guidelines?

Testers

If you would like to test this pull request then please run: ./scripts/github-apply <pr_id>, i.e ./scripts/github-apply 5926

I've tested php build-base.php and web installer both whilst running cron, validate and discovery to see if I could a) break the lock feature and/or b) have validate turn up bad schema which I couldn't on both accounts.

This is to stop the race condition we have when discovery.php could invoke a schema update when daily.sh is already doing the same. Works for me.....

Should now allow #6433 to run now without worrying about it over-running.

@mention-bot

This comment has been minimized.

Show comment
Hide comment
@mention-bot

mention-bot Apr 19, 2017

Thank you for submitting a PR @laf! We have found the following @f0o, @murrant and @SaaldjorMike based on the history of these files to review this PR.

mention-bot commented Apr 19, 2017

Thank you for submitting a PR @laf! We have found the following @f0o, @murrant and @SaaldjorMike based on the history of these files to review this PR.

@LibreNMS-CI

This comment has been minimized.

Show comment
Hide comment
@LibreNMS-CI

LibreNMS-CI commented Apr 20, 2017

Auto-Deploy finished, Test PR at http://6469.ci.librenms.org or https://6469.ci.librenms.org

@laf laf referenced this pull request Apr 20, 2017

Closed

Overlapping instances of discovery -h new #4459

3 of 4 tasks complete
@murrant

This comment has been minimized.

Show comment
Hide comment
@murrant

murrant Apr 20, 2017

Member

@laf Do you think we should include lock expiration? That would allow us to break stuck locks eventually.

Member

murrant commented Apr 20, 2017

@laf Do you think we should include lock expiration? That would allow us to break stuck locks eventually.

@laf

This comment has been minimized.

Show comment
Hide comment
@laf

laf Apr 20, 2017

Member

@murrant shouldn't be difficult, get_lock() can probably do that check

Member

laf commented Apr 20, 2017

@murrant shouldn't be difficult, get_lock() can probably do that check

@laf

This comment has been minimized.

Show comment
Hide comment
@laf

laf Apr 20, 2017

Member

@murrant I actually think it does what you want already. So the lock isn't only checked if the file exists, it looks to see via ps if the pid previously recorded is still running, only if it is does the lock stay.

Member

laf commented Apr 20, 2017

@murrant I actually think it does what you want already. So the lock isn't only checked if the file exists, it looks to see via ps if the pid previously recorded is still running, only if it is does the lock stay.

@laf laf referenced this pull request Apr 27, 2017

Merged

Increased speed of loading syslog pages. #6433

2 of 2 tasks complete
@murrant

This comment has been minimized.

Show comment
Hide comment
@murrant

murrant Apr 28, 2017

Member

Sorry for not getting this tested sooner, but I think I'd like to push it to the next release so we can have a good lead time of testing.

Member

murrant commented Apr 28, 2017

Sorry for not getting this tested sooner, but I think I'd like to push it to the next release so we can have a good lead time of testing.

@murrant murrant added this to the May 2017 Release milestone Apr 28, 2017

@laf

This comment has been minimized.

Show comment
Hide comment
@laf

laf Apr 28, 2017

Member

No worries on my part.

Member

laf commented Apr 28, 2017

No worries on my part.

@LibreNMS-CI

This comment has been minimized.

Show comment
Hide comment
@LibreNMS-CI

LibreNMS-CI commented May 2, 2017

Auto-Deploy finished, Test PR at http://6469.ci.librenms.org or https://6469.ci.librenms.org

@laf

This comment has been minimized.

Show comment
Hide comment
@laf

laf May 2, 2017

Member

@murrant you ok with this now?

Member

laf commented May 2, 2017

@murrant you ok with this now?

@murrant

This comment has been minimized.

Show comment
Hide comment
@murrant

murrant May 3, 2017

Member

Yeah, I was going to apply it and try an update then merge it, but I got busy. If you are happy with it, you can merge.

Member

murrant commented May 3, 2017

Yeah, I was going to apply it and try an update then merge it, but I got busy. If you are happy with it, you can merge.

@LibreNMS-CI

This comment has been minimized.

Show comment
Hide comment
@LibreNMS-CI

LibreNMS-CI commented May 3, 2017

Auto-Deploy finished, Test PR at http://6469.ci.librenms.org or https://6469.ci.librenms.org

@scrutinizer-notifier

This comment has been minimized.

Show comment
Hide comment
@scrutinizer-notifier

scrutinizer-notifier May 3, 2017

The inspection completed: 3 updated code elements

scrutinizer-notifier commented May 3, 2017

The inspection completed: 3 updated code elements

@laf laf merged commit 41e7689 into librenms:master May 3, 2017

3 checks passed

Auto-Deploy Build finished.
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
license/cla Contributor License Agreement is signed.
Details

@laf laf deleted the laf:refactor/lock-db-updates branch May 3, 2017

@lock

This comment has been minimized.

Show comment
Hide comment
@lock

lock bot May 18, 2018

This thread has been automatically locked since there has not been any recent activity after it was closed.

lock bot commented May 18, 2018

This thread has been automatically locked since there has not been any recent activity after it was closed.

@lock lock bot locked as resolved and limited conversation to collaborators May 18, 2018

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.