)]}'
{"/PATCHSET_LEVEL":[{"author":{"_account_id":29244,"name":"Gregory Thiemonge","email":"gthiemon@redhat.com","username":"gthiemonge"},"change_message_id":"77d8848f5ecf027741e9f58a2fa79e089ce8693f","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":3,"id":"54f488d5_3e9bcbcf","updated":"2022-09-30 09:41:52.000000000","message":"I did a quick test:\n\ncreating a load balancer with a prometheus listener, and also an HTTP listener (no pool, no members, no hm)\n\nSep 30 11:37:11 devstack1 devstack@o-api.service[782612]: [pid: 782612|app: 0|req: 118950/237910] 192.168.122.115 () {66 vars in 1356 bytes} [Fri Sep 30 11:37:10 2022] POST /load-balancer/v2.0/lbaas/loadbalancers \u003d\u003e generated 711 bytes in 711 msecs (HTTP/1.1 201) 4 headers \nin 162 bytes (2 switches on core 0)\nSep 30 11:38:06 devstack1 devstack@o-api.service[782613]: INFO octavia.api.v2.controllers.listener [None req-29f7aa7b-a4fe-4d22-b9ff-0a671dc47c2c demo admin] Sending create Listener b6b9e4a1-9330-441c-a55e-e268a7657937 to provider amphora                                    \nSep 30 11:38:06 devstack1 devstack@o-api.service[782612]: INFO octavia.api.v2.controllers.listener [None req-0a60423c-1d9b-4dd8-b057-e5a1fa79dc89 demo admin] Load Balancer 41eedc64-fb50-43ad-b288-b874208a6d88 is immutable.                                                    Sep 30 11:38:06 devstack1 devstack@o-api.service[782612]: DEBUG wsme.api [None req-0a60423c-1d9b-4dd8-b057-e5a1fa79dc89 demo admin] Client-side error: Load Balancer 41eedc64-fb50-43ad-b288-b874208a6d88 is immutable and cannot be updated. {{(pid\u003d782612) format_exception /usr\n/local/lib/python3.9/site-packages/wsme/api.py:223}}                                                                                                                                                                                                                              Sep 30 11:38:06 devstack1 devstack@o-api.service[782612]: [pid: 782612|app: 0|req: 118979/237969] 192.168.122.115 () {66 vars in 1344 bytes} [Fri Sep 30 11:38:06 2022] POST /load-balancer/v2.0/lbaas/listeners \u003d\u003e generated 147 bytes in 100 msecs (HTTP/1.1 409) 4 headers in 1\n63 bytes (1 switches on core 0)                                                                                                                                                                                                                                                   Sep 30 11:38:06 devstack1 devstack@o-api.service[782613]: [pid: 782613|app: 0|req: 118991/237970] 192.168.122.115 () {66 vars in 1344 bytes} [Fri Sep 30 11:38:06 2022] POST /load-balancer/v2.0/lbaas/listeners \u003d\u003e generated 943 bytes in 122 msecs (HTTP/1.1 201) 4 headers in 1\n62 bytes (1 switches on core 0)                             \n\n\nIt seems that the creation of the 2nd listener conflicts with the creation of the first one ","commit_id":"4e48040c42a6d589aef272ae44c0a8bcbe289f96"}],"octavia_dashboard/api/rest/lbaasv2.py":[{"author":{"_account_id":29244,"name":"Gregory Thiemonge","email":"gthiemon@redhat.com","username":"gthiemonge"},"change_message_id":"2678d318dccf481aec2b250a52bc8aed464297c9","unresolved":true,"context_lines":[{"line_number":219,"context_line":"    if data[\u0027loadbalancer\u0027].get(\u0027prometheus\u0027):"},{"line_number":220,"context_line":"        args \u003d (request, loadbalancer.id, create_prometheus_listener)"},{"line_number":221,"context_line":"        kwargs \u003d {\u0027from_state\u0027: \u0027PENDING_CREATE\u0027}"},{"line_number":222,"context_line":"        thread.start_new_thread(poll_loadbalancer_status, args, kwargs)"},{"line_number":223,"context_line":""},{"line_number":224,"context_line":"    return _get_sdk_object_dict(loadbalancer)"},{"line_number":225,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"b8780d94_df3c16b9","line":222,"range":{"start_line":222,"start_character":15,"end_line":222,"end_character":31},"updated":"2022-09-30 09:42:49.000000000","message":"it seems that we are starting 2 threads using the same condition (from PENDING_CREATE), so we might request 2 listener creations at the same time","commit_id":"4e48040c42a6d589aef272ae44c0a8bcbe289f96"},{"author":{"_account_id":33408,"name":"Pierre-Yves Jourel","email":"pierre-yves.jourel@ovhcloud.com","username":"PYJ"},"change_message_id":"6cdf220253c65bd6dc608eb1e18a70f20f27fbfd","unresolved":false,"context_lines":[{"line_number":219,"context_line":"    if data[\u0027loadbalancer\u0027].get(\u0027prometheus\u0027):"},{"line_number":220,"context_line":"        args \u003d (request, loadbalancer.id, create_prometheus_listener)"},{"line_number":221,"context_line":"        kwargs \u003d {\u0027from_state\u0027: \u0027PENDING_CREATE\u0027}"},{"line_number":222,"context_line":"        thread.start_new_thread(poll_loadbalancer_status, args, kwargs)"},{"line_number":223,"context_line":""},{"line_number":224,"context_line":"    return _get_sdk_object_dict(loadbalancer)"},{"line_number":225,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"a6e6d007_f7556e4a","line":222,"range":{"start_line":222,"start_character":15,"end_line":222,"end_character":31},"in_reply_to":"b8780d94_df3c16b9","updated":"2022-10-04 18:41:25.000000000","message":"Ack, I moved the call for Prometheus directly in the creation of a listener. Now it works.","commit_id":"4e48040c42a6d589aef272ae44c0a8bcbe289f96"},{"author":{"_account_id":29244,"name":"Gregory Thiemonge","email":"gthiemon@redhat.com","username":"gthiemonge"},"change_message_id":"e507d26b64dba055503cba628f2078a9ac45428f","unresolved":true,"context_lines":[{"line_number":260,"context_line":""},{"line_number":261,"context_line":"    try:"},{"line_number":262,"context_line":"        if data[\u0027loadbalancer\u0027].get(\u0027prometheus\u0027):"},{"line_number":263,"context_line":"            args \u003d (request, kwargs[\u0027loadbalancer_id\u0027],"},{"line_number":264,"context_line":"                    create_prometheus_listener)"},{"line_number":265,"context_line":"            kwargs \u003d {\u0027from_state\u0027: \u0027PENDING_UPDATE\u0027}"},{"line_number":266,"context_line":"            thread.start_new_thread(poll_loadbalancer_status, args, kwargs)"}],"source_content_type":"text/x-python","patch_set":5,"id":"116785e1_94effd2a","line":263,"range":{"start_line":263,"start_character":29,"end_line":263,"end_character":35},"updated":"2022-10-27 08:59:21.000000000","message":"it doesn\u0027t work if we also create a pool, kwargs is redefined at line 258, so loadbalancer_id no longer exists in the dict.","commit_id":"27c3cc481acc7bc0d49962d0a5cd226a13097542"},{"author":{"_account_id":29244,"name":"Gregory Thiemonge","email":"gthiemon@redhat.com","username":"gthiemonge"},"change_message_id":"e507d26b64dba055503cba628f2078a9ac45428f","unresolved":true,"context_lines":[{"line_number":263,"context_line":"            args \u003d (request, kwargs[\u0027loadbalancer_id\u0027],"},{"line_number":264,"context_line":"                    create_prometheus_listener)"},{"line_number":265,"context_line":"            kwargs \u003d {\u0027from_state\u0027: \u0027PENDING_UPDATE\u0027}"},{"line_number":266,"context_line":"            thread.start_new_thread(poll_loadbalancer_status, args, kwargs)"},{"line_number":267,"context_line":"    except (KeyError):"},{"line_number":268,"context_line":"        pass"},{"line_number":269,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"8541ab27_d6bac9c0","line":266,"range":{"start_line":266,"start_character":0,"end_line":266,"end_character":12},"updated":"2022-10-27 08:59:21.000000000","message":"I still think that if we create a Prometheus listener (from the LB form) and a pool, we may have a race condition, 2 threads are going to wait for the LB to switch from PENDING_UPDATE to ACTIVE, and both threads might send 2 requests at the same time (one of them will be processed, the 2nd will be denied with a 409 - Conflict).\n\nI don\u0027t see a smart solution to this pbl (supporting the fully-populated LB API would work, but it\u0027s a huge work in octavia-dashboard)","commit_id":"27c3cc481acc7bc0d49962d0a5cd226a13097542"}]}
