Skip to content

Replace tab-delimited QueueEntry format with JSON serialization#381

Merged
ianks merged 1 commit intomainfrom
ianks/fix-queue-entry-json-serialization
Mar 25, 2026
Merged

Replace tab-delimited QueueEntry format with JSON serialization#381
ianks merged 1 commit intomainfrom
ianks/fix-queue-entry-json-serialization

Conversation

@ianks
Copy link
Copy Markdown
Contributor

@ianks ianks commented Mar 25, 2026

Situation

QueueEntry used \t as a delimiter between test_id and file_path in queue entries (#375). When a test name contains a literal tab — e.g. from dynamically generated XSS payload tests — parse splits on the wrong tab, producing a garbage file path that causes FileLoadError. Closes #379.

Execution

Replaced the tab-delimited format with JSON hash serialization ({"test_id":"...","file_path":"..."}). Entries without a file path remain plain strings. The Lua scripts (heartbeat.lua, reserve_lost.lua) now use Redis's built-in cjson.decode instead of string splitting, which also let us remove the entry_delimiter parameter threaded through HeartbeatProcess, Monitor, and Worker.

@ianks ianks force-pushed the ianks/fix-queue-entry-json-serialization branch from f674f6b to b740e69 Compare March 25, 2026 19:38
@ianks ianks requested a review from gmalette March 25, 2026 19:46
def self.test_id(entry)
pos = entry.index(DELIMITER)
pos ? entry[0, pos] : entry
return entry unless entry.start_with?('{')
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do all these entry.start_with? need to be there? Seems like the workers should all be running the same versoin

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 17204fd

@ianks ianks force-pushed the ianks/fix-queue-entry-json-serialization branch from 984a409 to 17204fd Compare March 25, 2026 20:05
@ianks ianks merged commit c8d5220 into main Mar 25, 2026
10 of 22 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

QueueEntry tab delimiter collides with test names containing literal tabs

2 participants