)]}'
{"doc/source/discussion/components.rst":[{"author":{"_account_id":30637,"name":"Jan Kubovy","email":"jan.kubovy@bmw.de","username":"kubovy"},"change_message_id":"3efadceb4d615ffc03ad2b798b4f4c68bdd2f079","unresolved":false,"context_lines":[{"line_number":323,"context_line":""},{"line_number":324,"context_line":"      Path to log config file."},{"line_number":325,"context_line":""},{"line_number":326,"context_line":"   .. attr:: paused_on_start"},{"line_number":327,"context_line":""},{"line_number":328,"context_line":"      Starts the scheduler in paused mode."},{"line_number":329,"context_line":"      See :ref:`scheduler_operation`."},{"line_number":330,"context_line":""},{"line_number":331,"context_line":"   .. attr:: pidfile"},{"line_number":332,"context_line":"      :default: /var/run/zuul/scheduler.pid"}],"source_content_type":"text/x-rst","patch_set":10,"id":"3f4c43b2_b4ea3872","line":329,"range":{"start_line":326,"start_character":1,"end_line":329,"end_character":37},"updated":"2020-04-15 12:50:04.000000000","message":"Not sure if we want to document this option at this time","commit_id":"21e21c150af029768f0fe3bd4c484471b927ac41"},{"author":{"_account_id":9311,"name":"Tristan Cacqueray","email":"tdecacqu@redhat.com","username":"tristanC"},"change_message_id":"ca918de5ac2a2083d16d8d10f761017d8878aae2","unresolved":false,"context_lines":[{"line_number":325,"context_line":""},{"line_number":326,"context_line":"   .. attr:: paused_on_start"},{"line_number":327,"context_line":""},{"line_number":328,"context_line":"      Starts the scheduler in paused mode."},{"line_number":329,"context_line":"      See :ref:`scheduler_operation`."},{"line_number":330,"context_line":""},{"line_number":331,"context_line":"   .. attr:: pidfile"}],"source_content_type":"text/x-rst","patch_set":32,"id":"9f560f44_785af9f1","line":328,"updated":"2020-09-08 19:15:09.000000000","message":"Perhaps the documentation should explain what is the purpose of this option, what is the use-case?","commit_id":"6659c84418ff24ccc869b6ebb10c1b65f72d0bfb"},{"author":{"_account_id":30637,"name":"Jan Kubovy","email":"jan.kubovy@bmw.de","username":"kubovy"},"change_message_id":"aea596fa4748af694a1af9e53f3dcc0aefc61e1b","unresolved":false,"context_lines":[{"line_number":325,"context_line":""},{"line_number":326,"context_line":"   .. attr:: paused_on_start"},{"line_number":327,"context_line":""},{"line_number":328,"context_line":"      Starts the scheduler in paused mode."},{"line_number":329,"context_line":"      See :ref:`scheduler_operation`."},{"line_number":330,"context_line":""},{"line_number":331,"context_line":"   .. attr:: pidfile"}],"source_content_type":"text/x-rst","patch_set":32,"id":"9f560f44_bc6089a6","line":328,"in_reply_to":"9f560f44_785af9f1","updated":"2020-09-30 14:32:50.000000000","message":"Done: It is primarily useful for testing purposes. This would make this option a candidate to be hidden. I also believe that in a multi-scheduler deployment eventually it will make sense to be able to start some instances in paused mode for maintenance/debugging purpose.","commit_id":"6659c84418ff24ccc869b6ebb10c1b65f72d0bfb"}],"tests/base.py":[{"author":{"_account_id":4146,"name":"Clark Boylan","email":"cboylan@sapwetik.org","username":"cboylan"},"change_message_id":"6014766b7a69e4a375f5ed7740344785e585573a","unresolved":false,"context_lines":[{"line_number":3670,"context_line":""},{"line_number":3671,"context_line":"        self.sched.start()"},{"line_number":3672,"context_line":"        executor_client.gearman.waitForServer()"},{"line_number":3673,"context_line":"        if self.sched.is_resumed:"},{"line_number":3674,"context_line":"            self.sched.reconfigure(self.config)"},{"line_number":3675,"context_line":"        self.sched.wakeUp()"},{"line_number":3676,"context_line":""}],"source_content_type":"text/x-python","patch_set":40,"id":"9f560f44_66730950","line":3673,"updated":"2020-09-29 22:25:48.000000000","message":"Re: discussion in patchset 28 I think we should consider removing this condition so that we can simplify the check in the scheduler that has us reconfigure if resuming.","commit_id":"13e81b6fbbff67a033ac0a09a2e3362c7b80591a"}],"tests/unit/test_multi_scheduler.py":[{"author":{"_account_id":1,"name":"James E. Blair","email":"jim@acmegating.com","username":"corvus"},"change_message_id":"3c5b550cd544ba5417f7fbe2dc5bd201eff64192","unresolved":false,"context_lines":[{"line_number":1,"context_line":"# Copyright 2012 Hewlett-Packard Development Company, L.P."},{"line_number":2,"context_line":"#"},{"line_number":3,"context_line":"# Licensed under the Apache License, Version 2.0 (the \"License\"); you may"},{"line_number":4,"context_line":"# not use this file except in compliance with the License. You may obtain"}],"source_content_type":"text/x-python","patch_set":5,"id":"1fa4df85_ab2e4d8f","line":1,"updated":"2020-03-04 17:36:49.000000000","message":"Are you sure this is right?","commit_id":"72b6d78850e203241b464acbdf363dd0fdf2d270"},{"author":{"_account_id":16068,"name":"Tobias Henkel","email":"tobias.henkel@bmw.de","username":"tobias.henkel"},"change_message_id":"a779f8081867f1535adbc9744a5d9144732f71db","unresolved":false,"context_lines":[{"line_number":1,"context_line":"# Copyright 2012 Hewlett-Packard Development Company, L.P."},{"line_number":2,"context_line":"#"},{"line_number":3,"context_line":"# Licensed under the Apache License, Version 2.0 (the \"License\"); you may"},{"line_number":4,"context_line":"# not use this file except in compliance with the License. You may obtain"}],"source_content_type":"text/x-python","patch_set":5,"id":"1fa4df85_ac3743ff","line":1,"in_reply_to":"1fa4df85_ab2e4d8f","updated":"2020-03-04 21:00:55.000000000","message":"Copy paste issue ;)","commit_id":"72b6d78850e203241b464acbdf363dd0fdf2d270"},{"author":{"_account_id":30637,"name":"Jan Kubovy","email":"jan.kubovy@bmw.de","username":"kubovy"},"change_message_id":"4aec95fe5f8eaf7b61dbef277d3c2f28c2744bdc","unresolved":false,"context_lines":[{"line_number":1,"context_line":"# Copyright 2012 Hewlett-Packard Development Company, L.P."},{"line_number":2,"context_line":"#"},{"line_number":3,"context_line":"# Licensed under the Apache License, Version 2.0 (the \"License\"); you may"},{"line_number":4,"context_line":"# not use this file except in compliance with the License. You may obtain"}],"source_content_type":"text/x-python","patch_set":5,"id":"1fa4df85_ec8428d5","line":1,"in_reply_to":"1fa4df85_ac3743ff","updated":"2020-03-09 10:31:06.000000000","message":"Ups :)","commit_id":"72b6d78850e203241b464acbdf363dd0fdf2d270"},{"author":{"_account_id":9311,"name":"Tristan Cacqueray","email":"tdecacqu@redhat.com","username":"tristanC"},"change_message_id":"5f0dbe490f8cbb2662ad6815f867430e1da34473","unresolved":false,"context_lines":[{"line_number":39,"context_line":"        A \u003d self.fake_gerrit.addFakeChange(\u0027org/project\u0027, \u0027stable\u0027, \u0027A\u0027)"},{"line_number":40,"context_line":"        A.addApproval(\u0027Code-Review\u0027, 2)"},{"line_number":41,"context_line":"        self.fake_gerrit.addEvent(A.addApproval(\u0027Approved\u0027, 1))"},{"line_number":42,"context_line":""},{"line_number":43,"context_line":"        # When: Resuming scheduler"},{"line_number":44,"context_line":"        self.wait_timeout \u003d 90  # reset original value"},{"line_number":45,"context_line":"        self.scheds.first.sched.resume()"}],"source_content_type":"text/x-python","patch_set":8,"id":"df33271e_b2bf69a8","line":42,"updated":"2020-04-01 12:19:08.000000000","message":"should this test that no jobs are running before the resume?","commit_id":"9aed059a6df12904db1d521034ed5db0819ca07e"},{"author":{"_account_id":1,"name":"James E. Blair","email":"jim@acmegating.com","username":"corvus"},"change_message_id":"596170ac7219edff92d75e81973cdee96ea62bf1","unresolved":false,"context_lines":[{"line_number":57,"context_line":"                         \u0027label2\u0027)"},{"line_number":58,"context_line":""},{"line_number":59,"context_line":""},{"line_number":60,"context_line":"class TestMultiScheduler(ZuulTestCase):"},{"line_number":61,"context_line":"    tenant_config_file \u003d \u0027config/single-tenant/main.yaml\u0027"},{"line_number":62,"context_line":""},{"line_number":63,"context_line":"    def test_pause_resume(self):"}],"source_content_type":"text/x-python","patch_set":28,"id":"9f560f44_e06d74cc","line":60,"updated":"2020-08-26 16:12:33.000000000","message":"Why is this class (and this file) called multi scheduler?","commit_id":"fe52a387a728c9546e18c1a81e73a32f391506d2"},{"author":{"_account_id":30637,"name":"Jan Kubovy","email":"jan.kubovy@bmw.de","username":"kubovy"},"change_message_id":"7bd49c367ab3bae18eeab5fbd6c4abedf100e4f1","unresolved":false,"context_lines":[{"line_number":57,"context_line":"                         \u0027label2\u0027)"},{"line_number":58,"context_line":""},{"line_number":59,"context_line":""},{"line_number":60,"context_line":"class TestMultiScheduler(ZuulTestCase):"},{"line_number":61,"context_line":"    tenant_config_file \u003d \u0027config/single-tenant/main.yaml\u0027"},{"line_number":62,"context_line":""},{"line_number":63,"context_line":"    def test_pause_resume(self):"}],"source_content_type":"text/x-python","patch_set":28,"id":"9f560f44_e080d4c1","line":60,"in_reply_to":"9f560f44_e06d74cc","updated":"2020-08-26 16:37:19.000000000","message":"Because was supposed to test multiple schedulers.\n\nE.g.: \n  self.scheds.first.sched.pause(),\n  self.scheds.second.sched.resume(),\n  etc.\n\n\nNow, there are tests only for one but others should follow","commit_id":"fe52a387a728c9546e18c1a81e73a32f391506d2"}],"zuul/scheduler.py":[{"author":{"_account_id":1,"name":"James E. Blair","email":"jim@acmegating.com","username":"corvus"},"change_message_id":"3c5b550cd544ba5417f7fbe2dc5bd201eff64192","unresolved":false,"context_lines":[{"line_number":315,"context_line":"        self._paused \u003d self.config.getboolean(\u0027scheduler\u0027, \u0027paused_on_start\u0027)\\"},{"line_number":316,"context_line":"            if self.config.has_option(\u0027scheduler\u0027, \u0027paused_on_start\u0027)\\"},{"line_number":317,"context_line":"            else False"},{"line_number":318,"context_line":"        self._paused_loop \u003d False  # Paused loop entered"},{"line_number":319,"context_line":"        self._hibernate \u003d False"},{"line_number":320,"context_line":"        self._stopped \u003d False"},{"line_number":321,"context_line":"        self._zuul_app \u003d None"}],"source_content_type":"text/x-python","patch_set":5,"id":"1fa4df85_4b1f995a","line":318,"updated":"2020-03-04 17:36:49.000000000","message":"What\u0027s the use case for an admin to set paused_on_start?","commit_id":"72b6d78850e203241b464acbdf363dd0fdf2d270"},{"author":{"_account_id":16068,"name":"Tobias Henkel","email":"tobias.henkel@bmw.de","username":"tobias.henkel"},"change_message_id":"f00b6c44f3b53c34e42b9c8eae4f450d39b3989d","unresolved":false,"context_lines":[{"line_number":315,"context_line":"        self._paused \u003d self.config.getboolean(\u0027scheduler\u0027, \u0027paused_on_start\u0027)\\"},{"line_number":316,"context_line":"            if self.config.has_option(\u0027scheduler\u0027, \u0027paused_on_start\u0027)\\"},{"line_number":317,"context_line":"            else False"},{"line_number":318,"context_line":"        self._paused_loop \u003d False  # Paused loop entered"},{"line_number":319,"context_line":"        self._hibernate \u003d False"},{"line_number":320,"context_line":"        self._stopped \u003d False"},{"line_number":321,"context_line":"        self._zuul_app \u003d None"}],"source_content_type":"text/x-python","patch_set":5,"id":"1fa4df85_8c4da79b","line":318,"in_reply_to":"1fa4df85_4b1f995a","updated":"2020-03-04 21:00:10.000000000","message":"Afaik that\u0027s for the tests as long as the scheduler is not really cooperative so we can start multiple schedulers and run them in a controlled way one after the other (until they are cooperative we should keep them from loading the config at the same time). So I think that\u0027s needed for the followup change.","commit_id":"72b6d78850e203241b464acbdf363dd0fdf2d270"},{"author":{"_account_id":30637,"name":"Jan Kubovy","email":"jan.kubovy@bmw.de","username":"kubovy"},"change_message_id":"4aec95fe5f8eaf7b61dbef277d3c2f28c2744bdc","unresolved":false,"context_lines":[{"line_number":315,"context_line":"        self._paused \u003d self.config.getboolean(\u0027scheduler\u0027, \u0027paused_on_start\u0027)\\"},{"line_number":316,"context_line":"            if self.config.has_option(\u0027scheduler\u0027, \u0027paused_on_start\u0027)\\"},{"line_number":317,"context_line":"            else False"},{"line_number":318,"context_line":"        self._paused_loop \u003d False  # Paused loop entered"},{"line_number":319,"context_line":"        self._hibernate \u003d False"},{"line_number":320,"context_line":"        self._stopped \u003d False"},{"line_number":321,"context_line":"        self._zuul_app \u003d None"}],"source_content_type":"text/x-python","patch_set":5,"id":"1fa4df85_2a1a20cb","line":318,"in_reply_to":"1fa4df85_8c4da79b","updated":"2020-03-09 10:31:06.000000000","message":"I could also imagine that in a multi-scheduler environment it may be useful to start scheduler in paused mode. But yes, the current main reason is for testing.","commit_id":"72b6d78850e203241b464acbdf363dd0fdf2d270"},{"author":{"_account_id":9311,"name":"Tristan Cacqueray","email":"tdecacqu@redhat.com","username":"tristanC"},"change_message_id":"5f0dbe490f8cbb2662ad6815f867430e1da34473","unresolved":false,"context_lines":[{"line_number":306,"context_line":"        self.layout_lock \u003d threading.Lock()"},{"line_number":307,"context_line":"        self.run_handler_lock \u003d threading.Lock()"},{"line_number":308,"context_line":"        self.command_map \u003d {"},{"line_number":309,"context_line":"            \u0027pause\u0027: self.pause,"},{"line_number":310,"context_line":"            \u0027resume\u0027: self.resume,"},{"line_number":311,"context_line":"            \u0027stop\u0027: self.stop,"},{"line_number":312,"context_line":"            \u0027full-reconfigure\u0027: self.fullReconfigureCommandHandler,"}],"source_content_type":"text/x-python","patch_set":8,"id":"df33271e_3286b914","line":309,"range":{"start_line":309,"start_character":12,"end_line":309,"end_character":32},"updated":"2020-04-01 12:19:08.000000000","message":"might be good to add a release note for the pause/resume command.","commit_id":"9aed059a6df12904db1d521034ed5db0819ca07e"},{"author":{"_account_id":9311,"name":"Tristan Cacqueray","email":"tdecacqu@redhat.com","username":"tristanC"},"change_message_id":"5f0dbe490f8cbb2662ad6815f867430e1da34473","unresolved":false,"context_lines":[{"line_number":315,"context_line":"            \u0027norepl\u0027: self.stop_repl,"},{"line_number":316,"context_line":"        }"},{"line_number":317,"context_line":""},{"line_number":318,"context_line":"        self._paused \u003d self.config.getboolean(\u0027scheduler\u0027, \u0027paused_on_start\u0027)\\"},{"line_number":319,"context_line":"            if self.config.has_option(\u0027scheduler\u0027, \u0027paused_on_start\u0027)\\"},{"line_number":320,"context_line":"            else False"},{"line_number":321,"context_line":"        self._paused_loop \u003d False  # Paused loop entered"}],"source_content_type":"text/x-python","patch_set":8,"id":"df33271e_52837d04","line":318,"range":{"start_line":318,"start_character":23,"end_line":318,"end_character":77},"updated":"2020-04-01 12:19:08.000000000","message":"This option doesn\u0027t seem documented for the scheduler.","commit_id":"9aed059a6df12904db1d521034ed5db0819ca07e"},{"author":{"_account_id":16068,"name":"Tobias Henkel","email":"tobias.henkel@bmw.de","username":"tobias.henkel"},"change_message_id":"2a825df7ee5eda69de9f958a2c11a3905b5e03bb","unresolved":false,"context_lines":[{"line_number":315,"context_line":"            \u0027norepl\u0027: self.stop_repl,"},{"line_number":316,"context_line":"        }"},{"line_number":317,"context_line":""},{"line_number":318,"context_line":"        self._paused \u003d self.config.getboolean(\u0027scheduler\u0027, \u0027paused_on_start\u0027)\\"},{"line_number":319,"context_line":"            if self.config.has_option(\u0027scheduler\u0027, \u0027paused_on_start\u0027)\\"},{"line_number":320,"context_line":"            else False"},{"line_number":321,"context_line":"        self._paused_loop \u003d False  # Paused loop entered"}],"source_content_type":"text/x-python","patch_set":18,"id":"bf51134e_bbd4e1bc","line":318,"updated":"2020-07-06 15:40:09.000000000","message":"This can be simplified using the get_default utility function. You can see an example here: https://opendev.org/zuul/zuul/src/branch/master/zuul/executor/server.py#L2630\n\nThe type of the default defines the data type.","commit_id":"83b27bce0690a6bd48d4422ac43895b1b1a5655d"},{"author":{"_account_id":22348,"name":"Zuul","username":"zuul","tags":["SERVICE_USER"]},"tag":"autogenerated:zuul:check","change_message_id":"576059ee1aa393f3a1010efd0b4da86868bd42ef","unresolved":false,"context_lines":[{"line_number":46,"context_line":"from zuul.lib.statsd import get_statsd"},{"line_number":47,"context_line":"import zuul.lib.queue"},{"line_number":48,"context_line":"import zuul.lib.repl"},{"line_number":49,"context_line":"from zuul.model import Build, HoldRequest, Tenant, TriggerEvent"},{"line_number":50,"context_line":""},{"line_number":51,"context_line":"COMMANDS \u003d [\u0027full-reconfigure\u0027, \u0027smart-reconfigure\u0027,"},{"line_number":52,"context_line":"            \u0027pause\u0027, \u0027resume\u0027, \u0027stop\u0027,"}],"source_content_type":"text/x-python","patch_set":25,"id":"9f560f44_7dfeb805","line":49,"updated":"2020-08-18 11:59:49.000000000","message":"linters: F811 redefinition of unused \u0027TriggerEvent\u0027 from line 34","commit_id":"dc30b93d5762082eb3969be8cb50560fd7d840a8"},{"author":{"_account_id":4146,"name":"Clark Boylan","email":"cboylan@sapwetik.org","username":"cboylan"},"change_message_id":"574cf096451e4ad771f73c1457fb982d3624accc","unresolved":false,"context_lines":[{"line_number":1272,"context_line":"                self.log.debug(\"Run handler paused\")"},{"line_number":1273,"context_line":"                self._paused_loop \u003d True"},{"line_number":1274,"context_line":"                while self._paused:"},{"line_number":1275,"context_line":"                    time.sleep(0.1)"},{"line_number":1276,"context_line":"                self._paused_loop \u003d False"},{"line_number":1277,"context_line":"                self.log.debug(\"Run handler resumed\")"},{"line_number":1278,"context_line":"            self.log.debug(\"Run handler sleeping\")"}],"source_content_type":"text/x-python","patch_set":27,"id":"9f560f44_6fe859e1","line":1275,"updated":"2020-08-24 20:11:33.000000000","message":"Would it make sense to replace the sleep and check with another threading.Event.wait()? Then the resume command can set that event?\n\nTaking this idea further I wonder if we can use wake_event for handling pauses. I wouldn\u0027t worry about that in this change, but maybe something to think about as a follow on?","commit_id":"c28137b8340cdf9c824b8c678f16b69d7a18e4d8"},{"author":{"_account_id":30637,"name":"Jan Kubovy","email":"jan.kubovy@bmw.de","username":"kubovy"},"change_message_id":"f8ba6ec88df49360c6a0226c8069d85d65dbee91","unresolved":false,"context_lines":[{"line_number":1272,"context_line":"                self.log.debug(\"Run handler paused\")"},{"line_number":1273,"context_line":"                self._paused_loop \u003d True"},{"line_number":1274,"context_line":"                while self._paused:"},{"line_number":1275,"context_line":"                    time.sleep(0.1)"},{"line_number":1276,"context_line":"                self._paused_loop \u003d False"},{"line_number":1277,"context_line":"                self.log.debug(\"Run handler resumed\")"},{"line_number":1278,"context_line":"            self.log.debug(\"Run handler sleeping\")"}],"source_content_type":"text/x-python","patch_set":27,"id":"9f560f44_03eb7612","line":1275,"in_reply_to":"9f560f44_6fe859e1","updated":"2020-08-25 04:52:52.000000000","message":"Sure, i like it. Looks even more clean to me.","commit_id":"c28137b8340cdf9c824b8c678f16b69d7a18e4d8"},{"author":{"_account_id":1,"name":"James E. Blair","email":"jim@acmegating.com","username":"corvus"},"change_message_id":"f5d6455041d7126e6c86cd411bc107c13f0b28e6","unresolved":false,"context_lines":[{"line_number":397,"context_line":"        self.__resumed.set()"},{"line_number":398,"context_line":"        # Never reconfigured \u003d started in paused mode:"},{"line_number":399,"context_line":"        if self.last_reconfigured is None:"},{"line_number":400,"context_line":"            self.reconfigure(self.config)"},{"line_number":401,"context_line":"        self.wake_event.set()"},{"line_number":402,"context_line":""},{"line_number":403,"context_line":"    @property"}],"source_content_type":"text/x-python","patch_set":28,"id":"9f560f44_a007fc81","line":400,"updated":"2020-08-26 16:32:02.000000000","message":"I\u0027m pretty sure I\u0027m missing something -- I just don\u0027t see why that\u0027s the case.  Why doesn\u0027t it configure on start if it\u0027s paused?  If there\u0027s a line that says \"if not paused\", can you point me to it?","commit_id":"fe52a387a728c9546e18c1a81e73a32f391506d2"},{"author":{"_account_id":1,"name":"James E. Blair","email":"jim@acmegating.com","username":"corvus"},"change_message_id":"596170ac7219edff92d75e81973cdee96ea62bf1","unresolved":false,"context_lines":[{"line_number":397,"context_line":"        self.__resumed.set()"},{"line_number":398,"context_line":"        # Never reconfigured \u003d started in paused mode:"},{"line_number":399,"context_line":"        if self.last_reconfigured is None:"},{"line_number":400,"context_line":"            self.reconfigure(self.config)"},{"line_number":401,"context_line":"        self.wake_event.set()"},{"line_number":402,"context_line":""},{"line_number":403,"context_line":"    @property"}],"source_content_type":"text/x-python","patch_set":28,"id":"9f560f44_c07030a7","line":400,"updated":"2020-08-26 16:12:33.000000000","message":"Why is this necessary?  How does the initial configuration normally happen?","commit_id":"fe52a387a728c9546e18c1a81e73a32f391506d2"},{"author":{"_account_id":30637,"name":"Jan Kubovy","email":"jan.kubovy@bmw.de","username":"kubovy"},"change_message_id":"11cb32828ee6fd2149bc58160f0ab0dd100735f5","unresolved":false,"context_lines":[{"line_number":397,"context_line":"        self.__resumed.set()"},{"line_number":398,"context_line":"        # Never reconfigured \u003d started in paused mode:"},{"line_number":399,"context_line":"        if self.last_reconfigured is None:"},{"line_number":400,"context_line":"            self.reconfigure(self.config)"},{"line_number":401,"context_line":"        self.wake_event.set()"},{"line_number":402,"context_line":""},{"line_number":403,"context_line":"    @property"}],"source_content_type":"text/x-python","patch_set":28,"id":"9f560f44_86f3e608","line":400,"in_reply_to":"9f560f44_a007fc81","updated":"2020-08-27 08:48:45.000000000","message":"The location is in tests/base.py:3627. The problem is that the extra condition in the tests/base.py if remove will trigger reconfiguration on start (even in paused state) and then in theory this condition is not needed.\n\nBut, at line 655 in here in the #reconfigure method the \"event.wait()\" will block when scheduler is started in paused mode. Therefore, if scheduler is started in paused state #reconfigure shall not be triggered before it is resumed. Then #reconfigure should be triggered when #resume is called in case no reconfiguration was triggered yet.","commit_id":"fe52a387a728c9546e18c1a81e73a32f391506d2"},{"author":{"_account_id":30637,"name":"Jan Kubovy","email":"jan.kubovy@bmw.de","username":"kubovy"},"change_message_id":"387775e9af582fdf29c1002c8dc986106891c530","unresolved":false,"context_lines":[{"line_number":397,"context_line":"        self.__resumed.set()"},{"line_number":398,"context_line":"        # Never reconfigured \u003d started in paused mode:"},{"line_number":399,"context_line":"        if self.last_reconfigured is None:"},{"line_number":400,"context_line":"            self.reconfigure(self.config)"},{"line_number":401,"context_line":"        self.wake_event.set()"},{"line_number":402,"context_line":""},{"line_number":403,"context_line":"    @property"}],"source_content_type":"text/x-python","patch_set":28,"id":"9f560f44_60c7a465","line":400,"in_reply_to":"9f560f44_c07030a7","updated":"2020-08-26 16:26:02.000000000","message":"When the scheduler is started in paused mode it does not configure as the comment sais. That\u0027s why it is done explicitly here. Maybe I am missing something?","commit_id":"fe52a387a728c9546e18c1a81e73a32f391506d2"},{"author":{"_account_id":1,"name":"James E. Blair","email":"jim@acmegating.com","username":"corvus"},"change_message_id":"f5d6455041d7126e6c86cd411bc107c13f0b28e6","unresolved":false,"context_lines":[{"line_number":423,"context_line":"        self.wake_event.set()"},{"line_number":424,"context_line":""},{"line_number":425,"context_line":"    def stop(self):"},{"line_number":426,"context_line":"        self.__stopped \u003d True"},{"line_number":427,"context_line":"        self.stats_stop.set()"},{"line_number":428,"context_line":"        self.stopConnections()"},{"line_number":429,"context_line":"        self.wake_event.set()"}],"source_content_type":"text/x-python","patch_set":28,"id":"9f560f44_800ab886","line":426,"updated":"2020-08-26 16:32:02.000000000","message":"I understand the difference, but don\u0027t understand the policy change here.  Typically one would use double underscores if they wanted to protect a truly internal variable from access by an unfriendly subclass, or if they expected multiple subclasess to need the same variable name.  But I can\u0027t see that happening here, so I think we should stick with single underscores as we typically do.","commit_id":"fe52a387a728c9546e18c1a81e73a32f391506d2"},{"author":{"_account_id":1,"name":"James E. Blair","email":"jim@acmegating.com","username":"corvus"},"change_message_id":"596170ac7219edff92d75e81973cdee96ea62bf1","unresolved":false,"context_lines":[{"line_number":423,"context_line":"        self.wake_event.set()"},{"line_number":424,"context_line":""},{"line_number":425,"context_line":"    def stop(self):"},{"line_number":426,"context_line":"        self.__stopped \u003d True"},{"line_number":427,"context_line":"        self.stats_stop.set()"},{"line_number":428,"context_line":"        self.stopConnections()"},{"line_number":429,"context_line":"        self.wake_event.set()"}],"source_content_type":"text/x-python","patch_set":28,"id":"9f560f44_206becb6","line":426,"updated":"2020-08-26 16:12:33.000000000","message":"Why the changes to double underscores?","commit_id":"fe52a387a728c9546e18c1a81e73a32f391506d2"},{"author":{"_account_id":30637,"name":"Jan Kubovy","email":"jan.kubovy@bmw.de","username":"kubovy"},"change_message_id":"387775e9af582fdf29c1002c8dc986106891c530","unresolved":false,"context_lines":[{"line_number":423,"context_line":"        self.wake_event.set()"},{"line_number":424,"context_line":""},{"line_number":425,"context_line":"    def stop(self):"},{"line_number":426,"context_line":"        self.__stopped \u003d True"},{"line_number":427,"context_line":"        self.stats_stop.set()"},{"line_number":428,"context_line":"        self.stopConnections()"},{"line_number":429,"context_line":"        self.wake_event.set()"}],"source_content_type":"text/x-python","patch_set":28,"id":"9f560f44_00cce886","line":426,"in_reply_to":"9f560f44_206becb6","updated":"2020-08-26 16:26:02.000000000","message":"I am trying to hide internal variables not to be exposed outside if i touch them anyway. Double underscore \u003d private, single underscore \u003d protected (exposed).","commit_id":"fe52a387a728c9546e18c1a81e73a32f391506d2"},{"author":{"_account_id":30637,"name":"Jan Kubovy","email":"jan.kubovy@bmw.de","username":"kubovy"},"change_message_id":"aef0d311e60330a6c7e8071a93a0659546780638","unresolved":false,"context_lines":[{"line_number":423,"context_line":"        self.wake_event.set()"},{"line_number":424,"context_line":""},{"line_number":425,"context_line":"    def stop(self):"},{"line_number":426,"context_line":"        self.__stopped \u003d True"},{"line_number":427,"context_line":"        self.stats_stop.set()"},{"line_number":428,"context_line":"        self.stopConnections()"},{"line_number":429,"context_line":"        self.wake_event.set()"}],"source_content_type":"text/x-python","patch_set":28,"id":"9f560f44_40f6e05e","line":426,"in_reply_to":"9f560f44_800ab886","updated":"2020-08-26 16:41:54.000000000","message":"I was coming from the point: hide what you can and make it visible if needed. Since \"protected\" properties, methods are actually accessible as public, not only from a subclass. It also makes it bit easier to navigate the code when not as much things are visible. I would actually consider this \"stopped\" property to be truly internal variable. But sure, I can change that back.","commit_id":"fe52a387a728c9546e18c1a81e73a32f391506d2"},{"author":{"_account_id":9311,"name":"Tristan Cacqueray","email":"tdecacqu@redhat.com","username":"tristanC"},"change_message_id":"ca918de5ac2a2083d16d8d10f761017d8878aae2","unresolved":false,"context_lines":[{"line_number":1265,"context_line":"            self.log.debug(\"Statsd not configured\")"},{"line_number":1266,"context_line":"        while True:"},{"line_number":1267,"context_line":"            if (not self.is_resumed and"},{"line_number":1268,"context_line":"                    self.management_event_queue.empty() and"},{"line_number":1269,"context_line":"                    self.result_event_queue.empty() and"},{"line_number":1270,"context_line":"                    self.trigger_event_queue.empty()):"},{"line_number":1271,"context_line":"                self.log.debug(\"Run handler paused\")"},{"line_number":1272,"context_line":"                self.is_paused \u003d True"},{"line_number":1273,"context_line":"                self._resumed.wait()"}],"source_content_type":"text/x-python","patch_set":32,"id":"9f560f44_98a6edbf","line":1270,"range":{"start_line":1268,"start_character":0,"end_line":1270,"end_character":53},"updated":"2020-09-08 19:15:09.000000000","message":"Shouldn\u0027t the handler be pause no matter what is the status of the queue when `not self.is_resumed` is true?","commit_id":"6659c84418ff24ccc869b6ebb10c1b65f72d0bfb"},{"author":{"_account_id":30637,"name":"Jan Kubovy","email":"jan.kubovy@bmw.de","username":"kubovy"},"change_message_id":"aea596fa4748af694a1af9e53f3dcc0aefc61e1b","unresolved":false,"context_lines":[{"line_number":1265,"context_line":"            self.log.debug(\"Statsd not configured\")"},{"line_number":1266,"context_line":"        while True:"},{"line_number":1267,"context_line":"            if (not self.is_resumed and"},{"line_number":1268,"context_line":"                    self.management_event_queue.empty() and"},{"line_number":1269,"context_line":"                    self.result_event_queue.empty() and"},{"line_number":1270,"context_line":"                    self.trigger_event_queue.empty()):"},{"line_number":1271,"context_line":"                self.log.debug(\"Run handler paused\")"},{"line_number":1272,"context_line":"                self.is_paused \u003d True"},{"line_number":1273,"context_line":"                self._resumed.wait()"}],"source_content_type":"text/x-python","patch_set":32,"id":"9f560f44_7cc27155","line":1270,"range":{"start_line":1268,"start_character":0,"end_line":1270,"end_character":53},"in_reply_to":"9f560f44_66fe69b0","updated":"2020-09-30 14:32:50.000000000","message":"Yes I can imagine such problem to actually happen. The pause/resume functionality is at this time meant for tests. We need to be able to control which scheduler is doing what. But I also see a practical use in production for maintenance or debug purposes.\n\nNow, however, that case you describe may actually happen. Even worse. When I look at it: the event queues are still getting events in but are not processing them \u003d\u003e queues are never empty \u003d\u003e pausing is not happening.\n\nWe should make sure that a paused scheduler does not accept new events. But I am not sure how to solve it here. The event processing needs to introduce some locking/caching mechanism over zookeeper not to loose events. This is done later on. Maybe moving this change after all components are connected to zk.\n\nWe could also simply just pause no matter what as Tristan suggests for now.","commit_id":"6659c84418ff24ccc869b6ebb10c1b65f72d0bfb"},{"author":{"_account_id":4146,"name":"Clark Boylan","email":"cboylan@sapwetik.org","username":"cboylan"},"change_message_id":"6014766b7a69e4a375f5ed7740344785e585573a","unresolved":false,"context_lines":[{"line_number":1265,"context_line":"            self.log.debug(\"Statsd not configured\")"},{"line_number":1266,"context_line":"        while True:"},{"line_number":1267,"context_line":"            if (not self.is_resumed and"},{"line_number":1268,"context_line":"                    self.management_event_queue.empty() and"},{"line_number":1269,"context_line":"                    self.result_event_queue.empty() and"},{"line_number":1270,"context_line":"                    self.trigger_event_queue.empty()):"},{"line_number":1271,"context_line":"                self.log.debug(\"Run handler paused\")"},{"line_number":1272,"context_line":"                self.is_paused \u003d True"},{"line_number":1273,"context_line":"                self._resumed.wait()"}],"source_content_type":"text/x-python","patch_set":32,"id":"9f560f44_66fe69b0","line":1270,"range":{"start_line":1268,"start_character":0,"end_line":1270,"end_character":53},"in_reply_to":"9f560f44_98a6edbf","updated":"2020-09-29 22:25:48.000000000","message":"I think the idea is to allow the scheduler to steady state with empty queues before pausing. However, I do wonder if that means a busy zuul would never properly pause? Might be something to evaluate as we start using the new feature?","commit_id":"6659c84418ff24ccc869b6ebb10c1b65f72d0bfb"},{"author":{"_account_id":4146,"name":"Clark Boylan","email":"cboylan@sapwetik.org","username":"cboylan"},"change_message_id":"6014766b7a69e4a375f5ed7740344785e585573a","unresolved":false,"context_lines":[{"line_number":391,"context_line":"        self._resumed.set()"},{"line_number":392,"context_line":"        # # Never reconfigured \u003d started in paused mode:"},{"line_number":393,"context_line":"        if self.last_reconfigured is None:"},{"line_number":394,"context_line":"            self.reconfigure(self.config)"},{"line_number":395,"context_line":"        self.wake_event.set()"},{"line_number":396,"context_line":""},{"line_number":397,"context_line":"    @property"}],"source_content_type":"text/x-python","patch_set":40,"id":"9f560f44_c699356e","line":394,"updated":"2020-09-29 22:25:48.000000000","message":"This is the code that I think we can simplify (remove?) if we update the code in tests/base.py as suggested in my other comment.","commit_id":"13e81b6fbbff67a033ac0a09a2e3362c7b80591a"},{"author":{"_account_id":4146,"name":"Clark Boylan","email":"cboylan@sapwetik.org","username":"cboylan"},"change_message_id":"fef19466d0be037bbdd6275b2c6c7ac001b242e4","unresolved":false,"context_lines":[{"line_number":1292,"context_line":"            try:"},{"line_number":1293,"context_line":"                while (not self.management_event_queue.empty() and"},{"line_number":1294,"context_line":"                       not self._stopped and"},{"line_number":1295,"context_line":"                       self.is_resumed):"},{"line_number":1296,"context_line":"                    self.process_management_queue()"},{"line_number":1297,"context_line":""},{"line_number":1298,"context_line":"                # Give result events priority -- they let us stop builds,"}],"source_content_type":"text/x-python","patch_set":40,"id":"9f560f44_86f0dd68","line":1295,"range":{"start_line":1295,"start_character":23,"end_line":1295,"end_character":38},"updated":"2020-09-29 22:46:50.000000000","message":"is_resumed is cleared when we pause. But we try to wait for empty queues above before waiting on _resumed. I think that means we\u0027ll just cycle in this loop unless the queues are already empty when we pause. Rather than doing the nicer to cpu wait() call.\n\nShould we drop this condition and let things flush before pausing? or drop the empty queues condition in the if above?\n\nPerhaps another approach is to start with the much simpler implementation at https://review.opendev.org/588610 and modify from there if necessary? Note this change flushes the management queue then doesn\u0027t bother with the state of the other queues before pausing.","commit_id":"13e81b6fbbff67a033ac0a09a2e3362c7b80591a"},{"author":{"_account_id":30637,"name":"Jan Kubovy","email":"jan.kubovy@bmw.de","username":"kubovy"},"change_message_id":"c981f1a9e09eecdbe77ecdeeb2680d1bef64a712","unresolved":false,"context_lines":[{"line_number":1292,"context_line":"            try:"},{"line_number":1293,"context_line":"                while (not self.management_event_queue.empty() and"},{"line_number":1294,"context_line":"                       not self._stopped and"},{"line_number":1295,"context_line":"                       self.is_resumed):"},{"line_number":1296,"context_line":"                    self.process_management_queue()"},{"line_number":1297,"context_line":""},{"line_number":1298,"context_line":"                # Give result events priority -- they let us stop builds,"}],"source_content_type":"text/x-python","patch_set":40,"id":"9f560f44_3faaa6d2","line":1295,"range":{"start_line":1295,"start_character":23,"end_line":1295,"end_character":38},"in_reply_to":"9f560f44_86f0dd68","updated":"2020-09-30 14:36:32.000000000","message":"I was originally not aware of 588610, but as also discussions in IRC suggests, lets use that. We will definitely need queues to go thru zookeeper for multi-scheduler so that any can take an event. At that point I think it will make sense to wait for queues to be empty.","commit_id":"13e81b6fbbff67a033ac0a09a2e3362c7b80591a"}]}
