Fix OPM port locking mechanism bug #695
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Related issue: CLOUDDST-23409
Several fixed bugs with the port locking mechanism:
Port_file_locks_generator
was changed to class. The reason is, that thisport_file_locks_generator
was throwing an exception (in the right way), however it was very difficult to debug, how and when it was called.create_port_filelocks
, we create a copy ofport_purposes
as previously we were working with data-object created when we used\@create_port_filelocks
decorator, however, this became a problem once we removed an item from the given array. The next call of this decorated function used the already edited value, which caused problems.create_port_filelocks
in thecreate_port_filelocks
even afterget_opm_port_stacks
call, as there could be a change, that theport_purposes_updated
would be empty, so thePortFileLockGenerator
would throw an error like "No free port has been found after 0 attempts"