[JIRA] (JENKINS-38906) Remove lock resource name from global configuration when lock is released
Title: Message Title Tobias Gruetzmacher resolved as Fixed This should be fixed with the ephemeral lock support in release 2.6 - Everthing that is created automatically is now removed automatically. Jenkins / JENKINS-38906 Remove lock resource name from global configuration when lock is released Change By: Tobias Gruetzmacher Status: Open Resolved Assignee: Antonio Muñiz Tobias Gruetzmacher Resolution: Fixed Released As: https://github.com/jenkinsci/lockable-resources-plugin/releases/tag/lockable-resources-2.6 Add Comment This message was sent by Atlassian Jira (v7.13.6#713006-sha1:cc4451f)
[JIRA] (JENKINS-38906) Remove lock resource name from global configuration when lock is released
Title: Message Title Aaron Marasco edited a comment on JENKINS-38906 Re: Remove lock resource name from global configuration when lock is released Using code from comments above, I have a Jenkins job that runs weekly to remove the ones that start with certain phrases . *This may have race conditions* (see later comments) :{code:java}stage ("JENKINS-38906") { def manager = org.jenkins.plugins.lockableresources.LockableResourcesManager.get() def resources = manager.getResources().findAll { (!it.locked) && ( it.name.startsWith("docker_rpminstalled") || it.name.startsWith("docker-rpmbuild") || it.name.startsWith("rpm-deploy") ) } currentBuild.description = "${resources.size()} locks" resources.each { println "Removing ${it.name}" manager.getResources().remove(it) } manager.save()} // stage{code} Add Comment This message was sent by Atlassian Jira (v7.11.2#711002-sha1:fdc329d) -- You received this message because you are subscribed to the Google Groups "Jenkins Issues" group. To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[JIRA] (JENKINS-38906) Remove lock resource name from global configuration when lock is released
Title: Message Title Aaron Marasco commented on JENKINS-38906 Re: Remove lock resource name from global configuration when lock is released Thanks Sami Korhonen for the heads-up. I don't need to worry about race conditions in my unique situation. However, I'll make a note in case others just see it and copypasta. Add Comment This message was sent by Atlassian Jira (v7.11.2#711002-sha1:fdc329d) -- You received this message because you are subscribed to the Google Groups "Jenkins Issues" group. To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[JIRA] (JENKINS-38906) Remove lock resource name from global configuration when lock is released
Title: Message Title Sami Korhonen edited a comment on JENKINS-38906 Re: Remove lock resource name from global configuration when lock is released We're using this to delete locks after our ansible plays:{code:java}@NonCPSdef deleteLocks(lockNames) { def manager = org.jenkins.plugins.lockableresources.LockableResourcesManager.get() synchronized (manager) {manager.getResources().removeAll { r -> lockNames.contains(r.name) && !r.locked && !r.reserved }manager.save() }} Edit: I had time to study problem further. While this does resolve race condition when deleting item from list, it still isn't sufficient. Current lock allocation algorithm relies that locks are not deleted in any way. I think that's something I can fix. However I think that algorithm needs major rework. Everything related lock management has to be done with atomic operations - and to do so, management must be done in a single class. There might be some scalability issues when allocating hundreds of locks, that could be resolved as well. {code} Add Comment This message was sent by Atlassian Jira (v7.11.2#711002-sha1:fdc329d) -- You received this message because you are subscribed to the Google Groups "Jenkins Issues" group. To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[JIRA] (JENKINS-38906) Remove lock resource name from global configuration when lock is released
Title: Message Title Sami Korhonen edited a comment on JENKINS-38906 Re: Remove lock resource name from global configuration when lock is released We're using this to delete locks after our ansible plays:{code:java}@NonCPSdef deleteLocks(lockNames) { def manager = org.jenkins.plugins.lockableresources.LockableResourcesManager.get() synchronized (manager) {manager.getResources().removeAll { r -> lockNames.contains(r.name) && !r.locked && !r.reserved }manager.save() }} {code} Edit: I had time to study problem further. While this does resolve race condition when deleting item from list, it still isn't sufficient. Current lock allocation algorithm relies that locks are not deleted in any way. I think that's something I can fix. However I think that algorithm needs major rework. Everything related lock management has to be done with atomic operations - and to do so, management must be done in a single class. There might be some scalability issues when allocating hundreds of locks, that could be resolved as well. {code} Add Comment This message was sent by Atlassian Jira (v7.11.2#711002-sha1:fdc329d) -- You received this message because you are subscribed to the Google Groups "Jenkins Issues" group. To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[JIRA] (JENKINS-38906) Remove lock resource name from global configuration when lock is released
Title: Message Title Sami Korhonen commented on JENKINS-38906 Re: Remove lock resource name from global configuration when lock is released We're using this to delete locks after our ansible plays: @NonCPS def deleteLocks(lockNames) { def manager = org.jenkins.plugins.lockableresources.LockableResourcesManager.get() synchronized (manager) { manager.getResources().removeAll { r -> lockNames.contains(r.name) && !r.locked && !r.reserved } manager.save() } } Add Comment This message was sent by Atlassian Jira (v7.11.2#711002-sha1:fdc329d) -- You received this message because you are subscribed to the Google Groups "Jenkins Issues" group. To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[JIRA] (JENKINS-38906) Remove lock resource name from global configuration when lock is released
Title: Message Title Sami Korhonen commented on JENKINS-38906 Re: Remove lock resource name from global configuration when lock is released Aaron Marasco You should synchronize access to LocalbleResouceManager, otherwise you might cause race condition. Considering LocakbleResourcesManager relies on synchronization, it should actually be a trivial task to delete lock after it has been released. Add Comment This message was sent by Atlassian Jira (v7.11.2#711002-sha1:fdc329d) -- You received this message because you are subscribed to the Google Groups "Jenkins Issues" group. To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[JIRA] (JENKINS-38906) Remove lock resource name from global configuration when lock is released
Title: Message Title Aaron Marasco edited a comment on JENKINS-38906 Re: Remove lock resource name from global configuration when lock is released Using code from comments above, I have a Jenkins job that runs weekly to remove the ones that start with certain phrases:{code:java} // AV-4738 and stage (" JENKINS-38906 ") { def manager = org.jenkins.plugins.lockableresources.LockableResourcesManager.get()def resources = manager.getResources().findAll {(!it.locked) && (it.name.startsWith("docker_rpminstalled") ||it.name.startsWith("docker-rpmbuild") ||it.name.startsWith("rpm-deploy"))} currentBuild.description = "${ resources. size()} locks" resources. each {println "Removing ${it.name}" manager.getResources().remove(it)}manager.save() } // stage {code} Add Comment This message was sent by Atlassian Jira (v7.11.2#711002-sha1:fdc329d) -- You received this message because you are subscribed to the Google Groups "Jenkins Issues" group. To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[JIRA] (JENKINS-38906) Remove lock resource name from global configuration when lock is released
Title: Message Title Aaron Marasco commented on JENKINS-38906 Re: Remove lock resource name from global configuration when lock is released Using code from comments above, I have a Jenkins job that runs weekly to remove the ones that start with certain phrases: // AV-4738 and JENKINS-38906 def manager = org.jenkins.plugins.lockableresources.LockableResourcesManager.get() def resources = manager.getResources().findAll { (!it.locked) && ( it.name.startsWith("docker_rpminstalled") || it.name.startsWith("docker-rpmbuild") || it.name.startsWith("rpm-deploy") ) } resources.each { println "Removing ${it.name}" manager.getResources().remove(it) } manager.save() Add Comment This message was sent by Atlassian Jira (v7.11.2#711002-sha1:fdc329d) -- You received this message because you are subscribed to the Google Groups "Jenkins Issues" group. To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[JIRA] (JENKINS-38906) Remove lock resource name from global configuration when lock is released
Title: Message Title Ricard F commented on JENKINS-38906 Re: Remove lock resource name from global configuration when lock is released Same case here Add Comment This message was sent by Atlassian Jira (v7.11.2#711002-sha1:fdc329d) -- You received this message because you are subscribed to the Google Groups "Jenkins Issues" group. To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[JIRA] (JENKINS-38906) Remove lock resource name from global configuration when lock is released
Title: Message Title Sam Van Oort commented on JENKINS-38906 Re: Remove lock resource name from global configuration when lock is released Vivek Pandey This one might be worth our team taking up, since locks are used rather heavily. Add Comment This message was sent by Atlassian Jira (v7.11.2#711002-sha1:fdc329d) -- You received this message because you are subscribed to the Google Groups "Jenkins Issues" group. To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[JIRA] (JENKINS-38906) Remove lock resource name from global configuration when lock is released
Title: Message Title Shaun Keenan commented on JENKINS-38906 Re: Remove lock resource name from global configuration when lock is released Bump - curious if anything can be done about this. Not having the ability to clean up locks that are auto-created seems like more than a "minor" priority... this could quickly balloon out of control. Thanks a lot for the cleanup suggestion Mikko P Add Comment This message was sent by Atlassian Jira (v7.11.2#711002-sha1:fdc329d) -- You received this message because you are subscribed to the Google Groups "Jenkins Issues" group. To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[JIRA] (JENKINS-38906) Remove lock resource name from global configuration when lock is released
Title: Message Title Antonio Muñiz assigned an issue to Antonio Muñiz Jenkins / JENKINS-38906 Remove lock resource name from global configuration when lock is released Change By: Antonio Muñiz Assignee: CloudBees Inc. Antonio Muñiz Add Comment This message was sent by Atlassian JIRA (v7.3.0#73011-sha1:3c73d0e) -- You received this message because you are subscribed to the Google Groups "Jenkins Issues" group. To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[JIRA] (JENKINS-38906) Remove lock resource name from global configuration when lock is released
Title: Message Title Antonio Muñiz commented on JENKINS-38906 Re: Remove lock resource name from global configuration when lock is released Removing on release would not be safe. +1 for the transient parameter. There should be a periodic background task looping on defined resources and removing those marked as transient and not used after a specific amount of time. Also transient resources should not be displayed in the administration page as it does not make sense to configure them nor remove them. Add Comment This message was sent by Atlassian JIRA (v7.3.0#73011-sha1:3c73d0e) -- You received this message because you are subscribed to the Google Groups "Jenkins Issues" group. To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[JIRA] (JENKINS-38906) Remove lock resource name from global configuration when lock is released
Title: Message Title Patrick Wolf assigned an issue to CloudBees Inc. Jenkins / JENKINS-38906 Remove lock resource name from global configuration when lock is released Change By: Patrick Wolf Assignee: CloudBees Inc. Add Comment This message was sent by Atlassian JIRA (v7.1.7#71011-sha1:2526d7c) -- You received this message because you are subscribed to the Google Groups "Jenkins Issues" group. To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[JIRA] (JENKINS-38906) Remove lock resource name from global configuration when lock is released
Title: Message Title Edward Easton commented on JENKINS-38906 Re: Remove lock resource name from global configuration when lock is released +1. Alternatively, add a flag to the resource that marks it as 'transient' and so is not stored in the global config. Something like: lock(name: 'my-resource', transient: true) { ... } Add Comment This message was sent by Atlassian JIRA (v7.1.7#71011-sha1:2526d7c) -- You received this message because you are subscribed to the Google Groups "Jenkins Issues" group. To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[JIRA] (JENKINS-38906) Remove lock resource name from global configuration when lock is released
Title: Message Title Ted Lifset created an issue Jenkins / JENKINS-38906 Remove lock resource name from global configuration when lock is released Issue Type: Improvement Assignee: Unassigned Components: lockable-resources-plugin Created: 2016/Oct/11 5:09 PM Priority: Minor Reporter: Ted Lifset 'Lockable Resources' within Jenkins global configuration can grow quickly when lock names are selected which are dynamically created and are transient in nature. Would be nice to clean-up the global configuration when locks released by removing the named lock value. Add Comment