)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":1,"name":"James E. Blair","email":"jim@acmegating.com","username":"corvus"},"change_message_id":"5401256a420ab073ebea3fb8cf132669355c7c98","unresolved":false,"context_lines":[{"line_number":10,"context_line":"but is expected to be returned as dict by kazoo at various places in"},{"line_number":11,"context_line":"zuul."},{"line_number":12,"context_line":"To fix that, let kazoo do the de-/serialization, just as we do at other"},{"line_number":13,"context_line":"places."},{"line_number":14,"context_line":""},{"line_number":15,"context_line":"Change-Id: I5162c08ad2cc69154e4daa0f2700be50c28a7049"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":3,"id":"075afd89_24bd339f","line":13,"updated":"2023-08-31 20:13:03.000000000","message":"Exactly what problem is being fixed here?  There should be no overlap between a node used by Zuul and a node used by Nodepool; and there is no type specification of user_data (it\u0027s user defined; that\u0027s why it\u0027s named that way).\n\nIf we did want to merge this, isn\u0027t there a migration issue?","commit_id":"ff0740f4e7950c5579993bd044dc333e23a6f8aa"}],"/PATCHSET_LEVEL":[{"author":{"_account_id":31083,"name":"Benjamin Schanzel","email":"benjamin.schanzel@bmw.de","username":"benjamin.schanzel"},"change_message_id":"5de22e9bc28ccb752cfd44f197c05af5ae80cd50","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":3,"id":"741a583d_04343d2b","updated":"2023-09-01 07:44:25.000000000","message":"Specifically, this broke the stats reporting because the user_data field is not explicitly deserialized in all places. In other drivers, we just set user_data as a dict and let kazoo do the de-/serialization. But here, for some reason, we json.loads/dumps explicitly and end up with a string instead of a dict if we don\u0027t pass it through json.loads.\n\nThe exception was\n```\n2023-07-06 14:23:18,362 ERROR zuul.Scheduler: Error in periodic stats:\nTraceback (most recent call last):\n  File \"/opt/zuul/lib/python3.10/site-packages/zuul/scheduler.py\", line 448, in runStats\n    self._runStats()\n  File \"/opt/zuul/lib/python3.10/site-packages/zuul/scheduler.py\", line 605, in _runStats\n    self.nodepool.emitStatsTotals(self.abide)\n  File \"/opt/zuul/lib/python3.10/site-packages/zuul/nodepool.py\", line 540, in emitStatsTotals\n    if node.user_data.get(\u0027zuul_system\u0027) !\u003d self.system_id:\nAttributeError: \u0027str\u0027 object has no attribute \u0027get\u0027\n```\n\nSide note: we have this fix running in prod already for several weeks now.","commit_id":"ff0740f4e7950c5579993bd044dc333e23a6f8aa"},{"author":{"_account_id":31083,"name":"Benjamin Schanzel","email":"benjamin.schanzel@bmw.de","username":"benjamin.schanzel"},"change_message_id":"9969c9fbde20862485553f1da788ba20d7a0e5d4","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":3,"id":"72e27b8a_77d1a2b8","updated":"2023-09-13 12:05:11.000000000","message":"Yes, correct, metastatic is the only driver that sets user_data, I should\u0027ve looked that up again, it\u0027s been a few weeks.\nSo, the field is usually set by zuul only, cf. https://opendev.org/zuul/zuul/src/branch/master/zuul/nodepool.py#L321\nZuul sets this as a dict, instead of json string (as the metastatic driver does here) and expects a dict coming back from kazoo. But the metastatic driver setting this after explicitly serializing the dict results in user_data being an escaped json string in zk. This is unexpected on the zuul-side. Instead setting it as a dict would make it\n1. compatible with zuul and\n2. a simpler solution in nodepool (skipping the json.loads/.dumps).\nI don\u0027t see an advantage in explicitly serializing/deserializing the user_data.","commit_id":"ff0740f4e7950c5579993bd044dc333e23a6f8aa"}]}
