Write locks on "any value"

I thought this would be possibly in TeamCity but it seems not. What I want is a shared resource with custom values, where you can grab WRITE locks on any value, which then blocks builds from getting only that value. Unfortunately it seems you can only grab all values when requesting a Write lock. I'd also like the read locks to be able to grab any value not write locked up to a limit, similar to the single value lock.

Is there any way to achieve anything like this in TeamCity? We've got multiple independent databases for testing, there's no need to grab all of them for writing, but I'd like to prevent other jobs from reading when a job is writing to one of them.

Daniel

3 comments
Comment actions Permalink

Hi Daniel,

For Resources with Custom values there are three types of locks: locks on any value, all or specific. Does the lock on specific value fits youe needs? If the value is already taken by a running build, the new build will wait in the queue until the value becomes available.

0
Comment actions Permalink

I want a lock on custom value where the write locks only lock the custom value they get, and the read locks have a quota.

0
Comment actions Permalink

Currently you can create a custom resource with list of values: database1, database2, etc. Then create a Shared resource build feature in the build configuration for this resource with Lock type: "Lock any value". In this case write lock for any value will be created. A build that uses the resource will start if at least one of the values is available. If all values are being used at the moment, the build will wait in the queue.
Also please watch and vote for the related request: https://youtrack.jetbrains.com/issue/TW-29383.

0

Please sign in to leave a comment.