compiler-explorer/infra

Logging issue concerning duplicate fields

partouf opened this issue · 3 comments

There's a record somewhere in the compile_stats logging that includes a duplicate 'skipasm' key.

HIVE_CURSOR_ERROR: Row is not a valid JSON Object - JSONException: Duplicate key "skipasm"

It's confusing as there's no actual field called skipasm, but I know it's part of the backendOptions. Perhaps someone manually put it in the Filters field and then had 2 differently cased skipasm entries?

Might be best to iterate over filters and lowercase here https://github.com/compiler-explorer/compiler-explorer/blob/f59bad3a7eb145245ce530a83fbba65e6a475821/lib/stats.ts#L86

Not sure how Object.fromEntries handles that. The situations not documented here https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/entries

Seems it handles it fine (and indeed differently cased keys are included)
https://jsfiddle.net/fkjd7s5e/

Tested solution, seems to work https://jsfiddle.net/fkjd7s5e/1/

Cute solution