)]}'
{"nova/cmd/scheduler.py":[{"author":{"_account_id":2813,"name":"Mehdi Abaakouk","email":"sileht@sileht.net","username":"sileht"},"change_message_id":"2d7c1b038e3f90e851b7f92d5b765f185d957bba","unresolved":false,"context_lines":[{"line_number":42,"context_line":"    gmr.TextGuruMeditation.setup_autorun(version)"},{"line_number":43,"context_line":""},{"line_number":44,"context_line":"    server \u003d service.Service.create(binary\u003d\u0027nova-scheduler\u0027,"},{"line_number":45,"context_line":"                                    topic\u003dCONF.scheduler_topic)"},{"line_number":46,"context_line":"    workers \u003d CONF.scheduler_workers or processutils.get_worker_count()"},{"line_number":47,"context_line":"    service.serve(server, workers\u003dworkers)"},{"line_number":48,"context_line":"    service.wait()"}],"source_content_type":"text/x-python","patch_set":1,"id":"9a80dd14_92456272","line":45,"updated":"2015-03-05 10:13:34.000000000","message":"service.Service.create() create a rpc server identified by a \u0027topic\u0027 and a \u0027server\u0027 (the oslo.messaging.Target)\n\nCreating multiple workers like this will result to have all workers that share the same identity. This is usually because the \u0027server\u0027 is set with the \u0027hostname\u0027, to make our life easier.\n\nWith rabbitmq for example, the \u0027server\u0027 attribute of the oslo.messaging.Target is used for a queue name, you usually have the following queues created:\n\n    scheduler\n    scheduler.scheduler-node-1\n    scheduler.scheduler-node-2\n    scheduler.scheduler-node-3\n    ...\n\nKeep things as-is will result that messages that go to scheduler.scheduler-node-1 will be processed randomly by the first ready worker. You will not be able to identify workers from the amqp point of view.\n\nThe side effect of that is if a worker stuck, bug or whatever and doesn\u0027t consume messages anymore, we will not be able to see it. One of the other worker will continue to notify that scheduler-node-1 works and consume new messages even if all of them are dead/stuck except one.\n\nSo I think that each rpc  servers (each workers) should have a different \u0027server\u0027 ,like: \n\n    scheduler\n    scheduler.scheduler-node-1-worker-1\n    scheduler.scheduler-node-1-worker-2\n    scheduler.scheduler-node-1-worker-3\n    scheduler.scheduler-node-2-worker-1\n    scheduler.scheduler-node-2-worker-2\n    scheduler.scheduler-node-3-worker-1\n    scheduler.scheduler-node-3-worker-2\n    ...\n\nWDYT, the side effect are acceptable or not ?","commit_id":"a5eeb6c8aaca4415c7b02f979e99c0ce71476feb"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"b211ca5b074103a7e4d6e50d730c6b6693fa716e","unresolved":false,"context_lines":[{"line_number":42,"context_line":"    gmr.TextGuruMeditation.setup_autorun(version)"},{"line_number":43,"context_line":""},{"line_number":44,"context_line":"    server \u003d service.Service.create(binary\u003d\u0027nova-scheduler\u0027,"},{"line_number":45,"context_line":"                                    topic\u003dCONF.scheduler_topic)"},{"line_number":46,"context_line":"    workers \u003d CONF.scheduler_workers or processutils.get_worker_count()"},{"line_number":47,"context_line":"    service.serve(server, workers\u003dworkers)"},{"line_number":48,"context_line":"    service.wait()"}],"source_content_type":"text/x-python","patch_set":1,"id":"3fa0c359_79d0c054","line":45,"in_reply_to":"9a80dd14_92456272","updated":"2018-02-14 20:17:40.000000000","message":"We do this exact same thing for nova-conductor workers...","commit_id":"a5eeb6c8aaca4415c7b02f979e99c0ce71476feb"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"0b761500229be7f49e57a35c4788d3d863988b9a","unresolved":false,"context_lines":[{"line_number":44,"context_line":"    server \u003d service.Service.create(binary\u003d\u0027nova-scheduler\u0027,"},{"line_number":45,"context_line":"                                    topic\u003dCONF.scheduler_topic)"},{"line_number":46,"context_line":"    workers \u003d CONF.scheduler_workers or processutils.get_worker_count()"},{"line_number":47,"context_line":"    service.serve(server, workers\u003dworkers)"},{"line_number":48,"context_line":"    service.wait()"}],"source_content_type":"text/x-python","patch_set":1,"id":"9a80dd14_9c71317a","line":47,"updated":"2015-03-04 09:17:28.000000000","message":"The current Scheduler design model is actually querying the DB so that it provides an HostState object to the filters. Once the host is found, it also calls a consume_from_instance method on that particular HostState.\n\nThe main problem is that consume_from_instance() is not thread-safe so two distinct workers could update the same HostState at the same time.\n\nI think the problem is wider than just decorating a semaphore : if the resource consumption is higher than the available resources, it won\u0027t throw an Exception so that the second worker would issue another selection.","commit_id":"a5eeb6c8aaca4415c7b02f979e99c0ce71476feb"},{"author":{"_account_id":5511,"name":"Nikola Dipanov","email":"ndipanov@redhat.com","username":"ndipanov"},"change_message_id":"0ec18a9778634700cee3feafb1f7ef32e3a695c1","unresolved":false,"context_lines":[{"line_number":44,"context_line":"    server \u003d service.Service.create(binary\u003d\u0027nova-scheduler\u0027,"},{"line_number":45,"context_line":"                                    topic\u003dCONF.scheduler_topic)"},{"line_number":46,"context_line":"    workers \u003d CONF.scheduler_workers or processutils.get_worker_count()"},{"line_number":47,"context_line":"    service.serve(server, workers\u003dworkers)"},{"line_number":48,"context_line":"    service.wait()"}],"source_content_type":"text/x-python","patch_set":1,"id":"9a80dd14_b22a662a","line":47,"in_reply_to":"9a80dd14_9c71317a","updated":"2015-03-05 10:04:38.000000000","message":"Actually this will not be affected by the lack of (green)thread safety of HostState. Workers will be spawned in individual processes (it uses the ProcessLauncher class from openstack.common).\n\nSo this is the same as spawning several scheduler services in a loop from the shell.\n\nHowever doing this does open us up to some race conditions that I will try to explain in more detail in a mail to the thread about this patch (though seeing how poorly this is understood, it probably requires a blogpost instead).","commit_id":"a5eeb6c8aaca4415c7b02f979e99c0ce71476feb"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"111ce898e1bc8fe52c3438acfc4d728bc0cdb598","unresolved":false,"context_lines":[{"line_number":46,"context_line":""},{"line_number":47,"context_line":"    server \u003d service.Service.create(binary\u003d\u0027nova-scheduler\u0027,"},{"line_number":48,"context_line":"                                    topic\u003dscheduler_rpcapi.RPC_TOPIC)"},{"line_number":49,"context_line":"    workers \u003d CONF.scheduler.workers or processutils.get_worker_count()"},{"line_number":50,"context_line":"    service.serve(server, workers\u003dworkers)"},{"line_number":51,"context_line":"    service.wait()"}],"source_content_type":"text/x-python","patch_set":2,"id":"3fa0c359_f24385ae","line":49,"updated":"2018-02-14 22:43:28.000000000","message":"Can we just use a sane default here and check:\n\nworkers \u003d CONF.scheduler.workers\nif not workers:\n    workers \u003d processutils.get_worker_count() if CONF.scheduler.driver \u003d\u003d \u0027filter_scheduler\u0027 else 1\n\n?","commit_id":"20a90b0f460615af045966397920fa48cc4fa685"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"24d965875e996478a3111e3996e317a8172b6df9","unresolved":false,"context_lines":[{"line_number":46,"context_line":""},{"line_number":47,"context_line":"    server \u003d service.Service.create(binary\u003d\u0027nova-scheduler\u0027,"},{"line_number":48,"context_line":"                                    topic\u003dscheduler_rpcapi.RPC_TOPIC)"},{"line_number":49,"context_line":"    workers \u003d CONF.scheduler.workers or processutils.get_worker_count()"},{"line_number":50,"context_line":"    service.serve(server, workers\u003dworkers)"},{"line_number":51,"context_line":"    service.wait()"}],"source_content_type":"text/x-python","patch_set":2,"id":"3fa0c359_40433c14","line":49,"in_reply_to":"3fa0c359_e91710a3","updated":"2018-02-18 22:08:39.000000000","message":"It\u0027s the only safe default case.","commit_id":"20a90b0f460615af045966397920fa48cc4fa685"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"6462543ccce023a2c8a24bae106329f392eabf6e","unresolved":false,"context_lines":[{"line_number":46,"context_line":""},{"line_number":47,"context_line":"    server \u003d service.Service.create(binary\u003d\u0027nova-scheduler\u0027,"},{"line_number":48,"context_line":"                                    topic\u003dscheduler_rpcapi.RPC_TOPIC)"},{"line_number":49,"context_line":"    workers \u003d CONF.scheduler.workers or processutils.get_worker_count()"},{"line_number":50,"context_line":"    service.serve(server, workers\u003dworkers)"},{"line_number":51,"context_line":"    service.wait()"}],"source_content_type":"text/x-python","patch_set":2,"id":"3fa0c359_e91710a3","line":49,"in_reply_to":"3fa0c359_f24385ae","updated":"2018-02-15 13:05:00.000000000","message":"Yeah, that seems like the right way to go, if it is in fact the case that _only_ the filter scheduler can have multiple workers.","commit_id":"20a90b0f460615af045966397920fa48cc4fa685"}],"nova/conf/scheduler.py":[{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"111ce898e1bc8fe52c3438acfc4d728bc0cdb598","unresolved":false,"context_lines":[{"line_number":146,"context_line":"This option is only used by the FilterScheduler; if you use a different"},{"line_number":147,"context_line":"scheduler, this option has no effect."},{"line_number":148,"context_line":"\"\"\"),"},{"line_number":149,"context_line":"    cfg.IntOpt(\"workers\","},{"line_number":150,"context_line":"        help\u003d\"\"\""},{"line_number":151,"context_line":"Number of workers for the nova-scheduler service. The default will be the"},{"line_number":152,"context_line":"number of CPUs available."}],"source_content_type":"text/x-python","patch_set":2,"id":"3fa0c359_7211b5ac","line":149,"updated":"2018-02-14 22:43:28.000000000","message":"This should probably have a minimum value of 0 (to trigger the ncpu logic).","commit_id":"20a90b0f460615af045966397920fa48cc4fa685"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"9a6fb53cf62c000d7958ecf1288da6de0c569b9e","unresolved":false,"context_lines":[{"line_number":146,"context_line":"This option is only used by the FilterScheduler; if you use a different"},{"line_number":147,"context_line":"scheduler, this option has no effect."},{"line_number":148,"context_line":"\"\"\"),"},{"line_number":149,"context_line":"    cfg.IntOpt(\"workers\","},{"line_number":150,"context_line":"        help\u003d\"\"\""},{"line_number":151,"context_line":"Number of workers for the nova-scheduler service. The default will be the"},{"line_number":152,"context_line":"number of CPUs available."}],"source_content_type":"text/x-python","patch_set":2,"id":"3fa0c359_206cf006","line":149,"in_reply_to":"3fa0c359_7211b5ac","updated":"2018-02-18 23:49:55.000000000","message":"Done","commit_id":"20a90b0f460615af045966397920fa48cc4fa685"}]}
