)]}'
{"oslo_service/service.py":[{"author":{"_account_id":14358,"name":"Marian Horban","email":"m.horban@gmail.com","username":"mhorban"},"change_message_id":"a7e8488073e2f32ed8ea8cf568e3eac8fbca637a","unresolved":false,"context_lines":[{"line_number":166,"context_line":"class Launcher(object):"},{"line_number":167,"context_line":"    \"\"\"Launch one or more services and wait for them to complete.\"\"\""},{"line_number":168,"context_line":""},{"line_number":169,"context_line":"    def __init__(self, conf, sighup_behaviour\u003d\u0027reload\u0027):"},{"line_number":170,"context_line":"        \"\"\"Initialize the service launcher."},{"line_number":171,"context_line":""},{"line_number":172,"context_line":"        :param sighup_behaviour: If \u0027reload\u0027, calls reload_config_files on"}],"source_content_type":"text/x-python","patch_set":1,"id":"fa69d971_9ccb4b1e","line":169,"updated":"2016-01-04 16:01:39.000000000","message":"What do you think if we use reload_hook instead sighup_behaviour. Argument will contain reference to self.conf.reload_config_files by default and optionally any function could be added","commit_id":"5c3ef1ee9398209722c59067eccce33b95246ae0"},{"author":{"_account_id":8688,"name":"Alexis Lee","email":"openstack@lxsli.co.uk","username":"lxsli"},"change_message_id":"8d97cfddf1316d58318287a6dbd5b78868e4f7e9","unresolved":false,"context_lines":[{"line_number":166,"context_line":"class Launcher(object):"},{"line_number":167,"context_line":"    \"\"\"Launch one or more services and wait for them to complete.\"\"\""},{"line_number":168,"context_line":""},{"line_number":169,"context_line":"    def __init__(self, conf, sighup_behaviour\u003d\u0027reload\u0027):"},{"line_number":170,"context_line":"        \"\"\"Initialize the service launcher."},{"line_number":171,"context_line":""},{"line_number":172,"context_line":"        :param sighup_behaviour: If \u0027reload\u0027, calls reload_config_files on"}],"source_content_type":"text/x-python","patch_set":1,"id":"fa69d971_ff27d90f","line":169,"in_reply_to":"fa69d971_9ccb4b1e","updated":"2016-01-04 16:18:24.000000000","message":"dhellmann was not keen on adding callback behaviour to oslo.config, I don\u0027t know if that applies to oslo.service as well. It would be more flexible, that can be both good and bad.","commit_id":"5c3ef1ee9398209722c59067eccce33b95246ae0"},{"author":{"_account_id":2813,"name":"Mehdi Abaakouk","email":"sileht@sileht.net","username":"sileht"},"change_message_id":"6e7f3ea5f5b8bdc4ab66a68a09e5090b306d4188","unresolved":false,"context_lines":[{"line_number":541,"context_line":"                if not _is_sighup_and_daemon(self.sigcaught):"},{"line_number":542,"context_line":"                    break"},{"line_number":543,"context_line":""},{"line_number":544,"context_line":"                self.conf.reload_config_files()"},{"line_number":545,"context_line":"                for service in set("},{"line_number":546,"context_line":"                        [wrap.service for wrap in self.children.values()]):"},{"line_number":547,"context_line":"                    service.reset()"}],"source_content_type":"text/x-python","patch_set":1,"id":"fa69d971_9c64ab49","line":544,"updated":"2016-01-04 15:59:22.000000000","message":"Should we use mutable here too ?","commit_id":"5c3ef1ee9398209722c59067eccce33b95246ae0"},{"author":{"_account_id":8688,"name":"Alexis Lee","email":"openstack@lxsli.co.uk","username":"lxsli"},"change_message_id":"8d97cfddf1316d58318287a6dbd5b78868e4f7e9","unresolved":false,"context_lines":[{"line_number":541,"context_line":"                if not _is_sighup_and_daemon(self.sigcaught):"},{"line_number":542,"context_line":"                    break"},{"line_number":543,"context_line":""},{"line_number":544,"context_line":"                self.conf.reload_config_files()"},{"line_number":545,"context_line":"                for service in set("},{"line_number":546,"context_line":"                        [wrap.service for wrap in self.children.values()]):"},{"line_number":547,"context_line":"                    service.reset()"}],"source_content_type":"text/x-python","patch_set":1,"id":"fa69d971_bf7881f3","line":544,"in_reply_to":"fa69d971_9c64ab49","updated":"2016-01-04 16:18:24.000000000","message":"derp - yes this is super-alpha quality, I only put it up to show mhorban+dims, thanks","commit_id":"5c3ef1ee9398209722c59067eccce33b95246ae0"},{"author":{"_account_id":7293,"name":"Elena Ezhova","email":"ezhovaelena19@gmail.com","username":"elena"},"change_message_id":"5256b872524971bad0fa2531891b85e6e9723657","unresolved":false,"context_lines":[{"line_number":199,"context_line":"        self.backdoor_port \u003d ("},{"line_number":200,"context_line":"            eventlet_backdoor.initialize_if_enabled(self.conf))"},{"line_number":201,"context_line":"        self.restart_method \u003d restart_method"},{"line_number":202,"context_line":"        if restart_method not in self._RESTART_METHODS:"},{"line_number":203,"context_line":"            raise ValueError(\"Invalid restart_method: %s\" % restart_method)"},{"line_number":204,"context_line":""},{"line_number":205,"context_line":"    def launch_service(self, service):"},{"line_number":206,"context_line":"        \"\"\"Load and start the given service."}],"source_content_type":"text/x-python","patch_set":9,"id":"1a122d0e_2c8e222e","line":203,"range":{"start_line":202,"start_character":8,"end_line":203,"end_character":75},"updated":"2016-04-26 09:28:11.000000000","message":"I see that \u0027restart_method\u0027 is validated in two places: here and in ProcessLauncher (L365). This check can be moved to the launch function as it\u0027s better to validate params as early as possible and besides we already validate \u0027workers\u0027 value there.","commit_id":"b84f7a6bc0c1364d3792cc5ba61da3bc0a4ca90c"},{"author":{"_account_id":7293,"name":"Elena Ezhova","email":"ezhovaelena19@gmail.com","username":"elena"},"change_message_id":"5256b872524971bad0fa2531891b85e6e9723657","unresolved":false,"context_lines":[{"line_number":200,"context_line":"            eventlet_backdoor.initialize_if_enabled(self.conf))"},{"line_number":201,"context_line":"        self.restart_method \u003d restart_method"},{"line_number":202,"context_line":"        if restart_method not in self._RESTART_METHODS:"},{"line_number":203,"context_line":"            raise ValueError(\"Invalid restart_method: %s\" % restart_method)"},{"line_number":204,"context_line":""},{"line_number":205,"context_line":"    def launch_service(self, service):"},{"line_number":206,"context_line":"        \"\"\"Load and start the given service."}],"source_content_type":"text/x-python","patch_set":9,"id":"1a122d0e_2c31025b","line":203,"range":{"start_line":203,"start_character":19,"end_line":203,"end_character":75},"updated":"2016-04-26 09:28:11.000000000","message":"nit: missing a marker function (_())","commit_id":"b84f7a6bc0c1364d3792cc5ba61da3bc0a4ca90c"},{"author":{"_account_id":8688,"name":"Alexis Lee","email":"openstack@lxsli.co.uk","username":"lxsli"},"change_message_id":"6016d229859386c5ce1839e816b5e23cba52605e","unresolved":false,"context_lines":[{"line_number":199,"context_line":"        self.backdoor_port \u003d ("},{"line_number":200,"context_line":"            eventlet_backdoor.initialize_if_enabled(self.conf))"},{"line_number":201,"context_line":"        self.restart_method \u003d restart_method"},{"line_number":202,"context_line":"        if restart_method not in self._RESTART_METHODS:"},{"line_number":203,"context_line":"            raise ValueError(\"Invalid restart_method: %s\" % restart_method)"},{"line_number":204,"context_line":""},{"line_number":205,"context_line":"    def launch_service(self, service):"},{"line_number":206,"context_line":"        \"\"\"Load and start the given service."}],"source_content_type":"text/x-python","patch_set":9,"id":"1a122d0e_62a7830b","line":203,"range":{"start_line":202,"start_character":8,"end_line":203,"end_character":75},"in_reply_to":"1a122d0e_2c8e222e","updated":"2016-04-26 10:23:44.000000000","message":"service.launch is not necessarily the only place which creates launchers, it\u0027s better to let the object guard its own state","commit_id":"b84f7a6bc0c1364d3792cc5ba61da3bc0a4ca90c"},{"author":{"_account_id":7293,"name":"Elena Ezhova","email":"ezhovaelena19@gmail.com","username":"elena"},"change_message_id":"5256b872524971bad0fa2531891b85e6e9723657","unresolved":false,"context_lines":[{"line_number":363,"context_line":"        self.handle_signal()"},{"line_number":364,"context_line":"        self.restart_method \u003d restart_method"},{"line_number":365,"context_line":"        if restart_method not in [\u0027reload\u0027, \u0027mutate\u0027]:"},{"line_number":366,"context_line":"            raise ValueError(\"restart_method must be \u0027reload\u0027 or \u0027mutate\u0027\")"},{"line_number":367,"context_line":""},{"line_number":368,"context_line":"    def handle_signal(self):"},{"line_number":369,"context_line":"        \"\"\"Add instance\u0027s signal handlers to class handlers.\"\"\""}],"source_content_type":"text/x-python","patch_set":9,"id":"1a122d0e_cc404ea8","line":366,"range":{"start_line":366,"start_character":18,"end_line":366,"end_character":75},"updated":"2016-04-26 09:28:11.000000000","message":"nit: missing a marker function (_())","commit_id":"b84f7a6bc0c1364d3792cc5ba61da3bc0a4ca90c"},{"author":{"_account_id":7293,"name":"Elena Ezhova","email":"ezhovaelena19@gmail.com","username":"elena"},"change_message_id":"8a06ccc4d9c8a4d5d235f24e7bfd696b2d7a08d0","unresolved":false,"context_lines":[{"line_number":713,"context_line":"            done.wait()"},{"line_number":714,"context_line":""},{"line_number":715,"context_line":""},{"line_number":716,"context_line":"def launch(conf, service, workers\u003d1, restart_method\u003d\u0027reload\u0027):"},{"line_number":717,"context_line":"    \"\"\"Launch a service with a given number of workers."},{"line_number":718,"context_line":""},{"line_number":719,"context_line":"    :param conf: an instance of ConfigOpts"}],"source_content_type":"text/x-python","patch_set":13,"id":"1a122d0e_c5cf4627","line":716,"range":{"start_line":716,"start_character":37,"end_line":716,"end_character":60},"updated":"2016-04-28 09:59:04.000000000","message":"Please add doc line for this.","commit_id":"6c9cf32768d69d675b7de642fb3b2e84ba7c2de0"}],"oslo_service/tests/test_service.py":[{"author":{"_account_id":7293,"name":"Elena Ezhova","email":"ezhovaelena19@gmail.com","username":"elena"},"change_message_id":"fa2f361b001881079aa15574f395ea2fb080f170","unresolved":false,"context_lines":[{"line_number":318,"context_line":"            self.conf.register_mutate_hook(lambda c, f: mutate.set())"},{"line_number":319,"context_line":"            return ServiceWithTimer(ready)"},{"line_number":320,"context_line":""},{"line_number":321,"context_line":"        def launcher_maker():"},{"line_number":322,"context_line":"            return service.ProcessLauncher(self.conf, restart_method\u003d\u0027mutate\u0027)"},{"line_number":323,"context_line":""},{"line_number":324,"context_line":"        self.pid \u003d self._spawn_service(1, service_maker, launcher_maker)"},{"line_number":325,"context_line":""}],"source_content_type":"text/x-python","patch_set":11,"id":"1a122d0e_1b5396e3","line":322,"range":{"start_line":321,"start_character":8,"end_line":322,"end_character":78},"updated":"2016-04-26 12:32:01.000000000","message":"I\u0027m not sure launcher_maker is needed, you can just pass restart method to self._spawn_service and there call \n\nlauncher \u003d service.launch(self.conf, serv, workers\u003dworkers, restart_method\u003drestart_method)\n\nThis way you wouldn\u0027t have to pass launcher to service.launch as you do in https://review.openstack.org/#/c/289876/6/oslo_service/service.py","commit_id":"bcc2f54d0f95e9ed7e62e58098b654c8230d32ce"},{"author":{"_account_id":8688,"name":"Alexis Lee","email":"openstack@lxsli.co.uk","username":"lxsli"},"change_message_id":"7473121c8069ce3978164ca61e35cd3a8babe8dc","unresolved":false,"context_lines":[{"line_number":318,"context_line":"            self.conf.register_mutate_hook(lambda c, f: mutate.set())"},{"line_number":319,"context_line":"            return ServiceWithTimer(ready)"},{"line_number":320,"context_line":""},{"line_number":321,"context_line":"        def launcher_maker():"},{"line_number":322,"context_line":"            return service.ProcessLauncher(self.conf, restart_method\u003d\u0027mutate\u0027)"},{"line_number":323,"context_line":""},{"line_number":324,"context_line":"        self.pid \u003d self._spawn_service(1, service_maker, launcher_maker)"},{"line_number":325,"context_line":""}],"source_content_type":"text/x-python","patch_set":11,"id":"1a122d0e_d6fa95bc","line":322,"range":{"start_line":321,"start_character":8,"end_line":322,"end_character":78},"in_reply_to":"1a122d0e_1b5396e3","updated":"2016-04-26 12:58:55.000000000","message":"Then the next time someone needs to add \"just one more thing\" they pass that as well, and the _spawn_service signature gets messy again. Passing in a launcher constructor is a final solution that gives the caller the freedom to construct the launcher however they need to.\n\nAnother way to put it is that making a launcher is an external concern to _spawn_service\u0027s main job. By factoring this concern out, it enables _spawn_service to focus on spawning services. We want small, composable functions that do one thing well, not large functions that rigidly agglomerate multiple tasks.","commit_id":"bcc2f54d0f95e9ed7e62e58098b654c8230d32ce"},{"author":{"_account_id":8688,"name":"Alexis Lee","email":"openstack@lxsli.co.uk","username":"lxsli"},"change_message_id":"ead193d6fec34450a6c445c7508be3953ad4f8bf","unresolved":false,"context_lines":[{"line_number":318,"context_line":"            self.conf.register_mutate_hook(lambda c, f: mutate.set())"},{"line_number":319,"context_line":"            return ServiceWithTimer(ready)"},{"line_number":320,"context_line":""},{"line_number":321,"context_line":"        def launcher_maker():"},{"line_number":322,"context_line":"            return service.ProcessLauncher(self.conf, restart_method\u003d\u0027mutate\u0027)"},{"line_number":323,"context_line":""},{"line_number":324,"context_line":"        self.pid \u003d self._spawn_service(1, service_maker, launcher_maker)"},{"line_number":325,"context_line":""}],"source_content_type":"text/x-python","patch_set":11,"id":"1a122d0e_bfe697ad","line":322,"range":{"start_line":321,"start_character":8,"end_line":322,"end_character":78},"in_reply_to":"1a122d0e_3132f3a7","updated":"2016-04-28 08:35:42.000000000","message":"I can do that","commit_id":"bcc2f54d0f95e9ed7e62e58098b654c8230d32ce"},{"author":{"_account_id":7293,"name":"Elena Ezhova","email":"ezhovaelena19@gmail.com","username":"elena"},"change_message_id":"4a41d613980eec4e8e1363b06753cf2d4163448b","unresolved":false,"context_lines":[{"line_number":318,"context_line":"            self.conf.register_mutate_hook(lambda c, f: mutate.set())"},{"line_number":319,"context_line":"            return ServiceWithTimer(ready)"},{"line_number":320,"context_line":""},{"line_number":321,"context_line":"        def launcher_maker():"},{"line_number":322,"context_line":"            return service.ProcessLauncher(self.conf, restart_method\u003d\u0027mutate\u0027)"},{"line_number":323,"context_line":""},{"line_number":324,"context_line":"        self.pid \u003d self._spawn_service(1, service_maker, launcher_maker)"},{"line_number":325,"context_line":""}],"source_content_type":"text/x-python","patch_set":11,"id":"1a122d0e_3132f3a7","line":322,"range":{"start_line":321,"start_character":8,"end_line":322,"end_character":78},"in_reply_to":"1a122d0e_d6fa95bc","updated":"2016-04-27 08:25:41.000000000","message":"I understand you position, but changing library\u0027s API in order to make testing easier is not a good idea. Why construct a launcher and then pass it to service.launch when you can directly call launcher.launch_service?\n\nif launcher_maker:\n    launcher \u003d launcher_maker()\n    launcher.launch_service(serv, workers\u003dworkers)\nelse:\n    launcher \u003d service.launch(self.conf, serv, workers\u003dworker)","commit_id":"bcc2f54d0f95e9ed7e62e58098b654c8230d32ce"}]}
