Skip to content

[Bug] /metrics gzip compression sporadically fails with error 500 caused by java.nio.BufferOverflowException #22575

@lhotari

Description

@lhotari

Search before asking

  • I searched in the issues and found nothing similar.

Read release policy

  • I understand that unsupported versions don't get bug fixes. I will attempt to reproduce the issue on a supported version of Pulsar client and Pulsar broker.

Version

master

Minimal reproduce step

TBD

What did you expect to see?

getting /metrics with gzip compression shouldn't fail

What did you see instead?

it sometimes fails

Anything else?

The problem in the code is here:

// write gzip footer, integer values are in little endian byte order
compressBuffer.order(ByteOrder.LITTLE_ENDIAN);
// write CRC32 checksum
compressBuffer.putInt((int) crc.getValue());
// write uncompressed size
compressBuffer.putInt(deflater.getTotalIn());

putInts will fail if the compress buffer doesn't have remaining space.

Are you willing to submit a PR?

  • I'm willing to submit a PR!

Metadata

Metadata

Assignees

Labels

type/bugThe PR fixed a bug or issue reported a bug

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions