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

supersede: duplicate package in rings can cause failure in middle of non-atomic operation #1188

Closed
nilxam opened this issue Oct 11, 2017 · 3 comments
Assignees

Comments

@nilxam
Copy link
Contributor

nilxam commented Oct 11, 2017

llvm4 SR#532127(https://build.opensuse.org/request/show/532127) has been staged in Staging M, it was superseded by SR#533345 , staging-bot handles it in a strange way

  • the meta is erased - osc rdiff -M -c 1127 openSUSE:Factory:Staging:M
  • the package still was there in M - osc log openSUSE:Factory:Staging:M/llvm4
r1 | dimstar_suse | 2017-10-10 21:56:21 | 6bb682d548e680b266ea913306f19727 | unknown |
@jberry-suse
Copy link
Contributor

From journal:

sudo journalctl -u osrt-staging-bot-regular@openSUSE:Factory --since '-18 hours' --until '-17 hours'
Traceback (most recent call last):
  File "/usr/bin/osc", line 41, in <module>
    r = babysitter.run(osccli)
  File "/usr/lib/python2.7/site-packages/osc/babysitter.py", line 61, in run
    return prg.main(argv)
  File "/usr/lib/python2.7/site-packages/osc/cmdln.py", line 344, in main
    return self.cmd(args)
  File "/usr/lib/python2.7/site-packages/osc/cmdln.py", line 367, in cmd
    retval = self.onecmd(argv)
  File "/usr/lib/python2.7/site-packages/osc/cmdln.py", line 501, in onecmd
    return self._dispatch_cmd(handler, argv)
  File "/usr/lib/python2.7/site-packages/osc/cmdln.py", line 1232, in _dispatch_cmd
    return handler(argv[0], opts, *args)
  File "/usr/lib/osc-plugins/osc-staging.py", line 592, in do_staging
    ListCommand(api).perform(supersede=opts.supersede)
  File "/usr/lib/osc-plugins/osclib/list_command.py", line 26, in perform
    SupersedeCommand(self.api).perform()
  File "/usr/lib/osc-plugins/osclib/supersede_command.py", line 15, in perform
    for stage_info, code, request in self.api.dispatch_open_requests(requests):
  File "/usr/lib/osc-plugins/osclib/stagingapi.py", line 684, in dispatch_open_requests
    stage_info, code = self.update_superseded_request(rq, target_requests)
  File "/usr/lib/osc-plugins/osclib/stagingapi.py", line 610, in update_superseded_request
    review='declined')
  File "/usr/lib/osc-plugins/osclib/stagingapi.py", line 845, in rm_from_prj
    project = self.map_ring_package_to_subject(project, package)
  File "/usr/lib/osc-plugins/osclib/stagingapi.py", line 1125, in map_ring_package_to_subject
    if self.ring_packages.get(pkg) and self.rings.index(self.ring_packages.get(pkg)) == 2 and not project.endswith(':DVD'):
  File "/usr/lib/osc-plugins/osclib/stagingapi.py", line 110, in ring_packages
    self._ring_packages = self._generate_ring_packages()
  File "/usr/lib/osc-plugins/osclib/stagingapi.py", line 203, in _generate_ring_packages
    raise Exception(msg.format(pkg, ret[pkg], prj))
Exception: python-flake8 is defined in two projects (openSUSE:Factory:Rings:1-MinimalX and openSUSE:Factory:Rings:2-TestDVD)

@jberry-suse
Copy link
Contributor

jberry-suse commented Oct 12, 2017

Relevant lines seem to explain the behavior.

https://github.com/openSUSE/osc-plugin-factory/blob/a2ba667f262607826131cace758696c4751c40fd/osclib/stagingapi.py#L844-L845

Not sure what the proper way to handle this would be. Really we want the operation to be atomic, but no simple way of doing that. Could map before, but that seems somewhat arbitrary. Likely the best method is to ensure that when moving things between rings the package if first removed before added to new ring to ensure there are not duplicates.

I am inclined to close this since any of the code could crap out in the middle and no rollback of partial change...like API transactions with commit.

@jberry-suse jberry-suse self-assigned this Oct 12, 2017
@jberry-suse jberry-suse changed the title staging-bot unselecting/supersedeing request in a strange way supersede: duplicate package in rings can cause failure in middle of non-atomic operation Oct 12, 2017
@jberry-suse
Copy link
Contributor

Feel free to re-open if you believe something more should be done. The workflow should be reflect in #848.

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

No branches or pull requests

2 participants