Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add oversized allocation to bad log lines #16083

Merged
merged 1 commit into from
Jan 23, 2024

Conversation

ballard26
Copy link
Contributor

This will cause a ducktape test to fail if an allocation of 400KiB or more occurs during it.

Backports Required

  • none - not a bug fix
  • none - this is a backport
  • none - issue does not exist in previous branches
  • none - papercut/not impactful enough to backport
  • v23.3.x
  • v23.2.x
  • v23.1.x

Release Notes

  • none

f"Ignoring oversized allocation, {m.group(1)} is less than the max allowable allocation size of {MAX_ALLOCATION_SIZE} bytes"
)
allowed = True
break
Copy link
Member

Choose a reason for hiding this comment

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

This needs to be a continue otherwise we ignore other potential log lines? Seems broken in the leak sanitizer check as well.

Copy link
Member

Choose a reason for hiding this comment

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

LeakSanitizer looks like it's doing the right thing: the break is in a nested for which is re-grepping the entire log (!!) to see if the leak is small enough to ignored, so it should just result in skipping to the next line.

The break here def looks like it would silently skip the rest of the lines though, good eye!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Nice catch, fixing now

@@ -1317,6 +1321,15 @@ def raise_on_bad_logs(self, allow_list=None):
allowed = True
break

if "oversized allocation" in line:
m = re.search("oversized allocation: (\d+) byte", line)
Copy link
Member

Choose a reason for hiding this comment

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

Just checking because I always struggle with regexes. It not saying "bytes" at the end there is fine? This is a simple match?

Copy link
Member

Choose a reason for hiding this comment

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

search() is the one that looks for a match anywhere in the line, i.e., with arbitrary leading and trailing unmatched characters so this would match ... bytes.

@@ -186,6 +186,9 @@
re.compile("finject - .* flush called concurrently with other operations")
]

# Largest allocation allowed in during a test
Copy link
Member

Choose a reason for hiding this comment

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

nit: the largest allocation allowed is 1 less than this value since we use < with this on the rhs

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Nice find, making it the actual largest alloc allowable.

@travisdowns
Copy link
Member

@ballard26 looks good other the the break issue identified by @StephanDollberg.

Were you able to test this in any way? Maybe a dummy PR with the max value set to 64k or something since that should definitely turn up some failures.

@ballard26
Copy link
Contributor Author

ballard26 commented Jan 12, 2024

Were you able to test this in any way? Maybe a dummy PR with the max value set to 64k or something since that should definitely turn up some failures.

I've tested it locally with two different admin API endpoints. One that makes and allocation of 300KiB and one that makes an allocation of 500KiB. It works as expected allowing for 300KiB, but leaving a warning in the log, and failing the test for 500KiB.

@piyushredpanda
Copy link
Contributor

This was all discussed and feedback addressed per @ballard26 ; merging.

@piyushredpanda piyushredpanda merged commit 6ba49d9 into redpanda-data:dev Jan 23, 2024
15 of 17 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.

None yet

5 participants