Skip to content

terms: reject a term that has no action - #96

Open
arpitjain099 wants to merge 1 commit into
pingcap:masterfrom
arpitjain099:fix/reject-term-without-action
Open

arpitjain099 wants to merge 1 commit into
pingcap:masterfrom
arpitjain099:fix/reject-term-without-action

Conversation

@arpitjain099

Copy link
Copy Markdown
Contributor

What problem does this PR solve?

A term is a modifier, an action and an optional value, but parseTerm only rejects a term whose text is empty. 1* or 100% gets its text from the modifier alone, so it parses with a nil act func. Enable returns no error, and the nil is dereferenced the first time the failpoint is evaluated, in whichever goroutine reached it rather than the one that enabled it. A PUT to the HTTP handler with that body answers 204 and the process dies later.

What is changed and how it works?

parseTerm now returns nil when parseAct found no action, so parse reports its existing parse error. Covered in terms_test.go.

Check List

Tests

  • Unit test

Co-Authored-By: Claude <noreply@anthropic.com>
Signed-off-by: Arpit Jain <arpitjain099@gmail.com>
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.

1 participant