Fix production hang and nil-priority crash in epic sync - #23
Merged
ImTheKai merged 2 commits intoAug 12, 2026
Conversation
upsert_epic (the per-sync path run on every JiraSyncJob tick) set priority to priority_int(...) with no fallback. epics.priority is NOT NULL default 0, so an epic that loses its Jira priority field would raise on every sync tick, matching the fallback already used in discover_closed_epics!. Signed-off-by: Kai Wagner <kai.wagner@percona.com>
jira_wiki_to_html's blank-line check used line.strip.empty?, which does not strip U+00A0. A line containing only a non-breaking space (seen in a real Jira ticket description) fell through to the paragraph branch, whose continuation loop uses Rails' .present? and correctly treats it as blank -- so the loop consumed zero lines and never advanced, spinning the request thread at ~100% CPU forever. Switched to line.blank? so both checks agree on what counts as blank. Signed-off-by: Kai Wagner <kai.wagner@percona.com>
dutow
approved these changes
Aug 12, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
upsert_epicinapp/services/jira_sync.rbsetprioritywith no fallback fornil.epics.priorityisNOT NULL default 0, so any epic that loses its Jira priority field crashesJiraSyncJobon every sync tick.discover_closed_epics!already had the|| 0fallback; this brings the main per-tick path in line with it.jira_wiki_to_htmlinapp/models/issue.rbusedline.strip.empty?to detect blank lines, but plain Rubystripdoesn't remove U+00A0 (non-breaking space). A real Jira ticket description (PG-2635) had a line containing only a non-breaking space, which fell through to the paragraph-continuation loop — that loop uses Rails'.present?, which does treat it as blank, so it consumed zero lines and never advanced. The result was an infinite loop pinning the Puma request thread at ~100% CPU forever, with no exception and no process crash, which is why the outage was hard to detect (Solid Queue background jobs, running in separate forked processes, kept working fine the whole time).