Skip to content

BaseWriteChannel.setChunkSize rounds down to the nearest kilobyte instead of up #2895

@anuraaga

Description

@anuraaga

Currently, when a user sets a chunk size, the channel rounds this down to the nearest multiple of MIN_CHUNK_SIZE (256K)

https://github.com/GoogleCloudPlatform/google-cloud-java/blob/master/google-cloud-core/src/main/java/com/google/cloud/BaseWriteChannel.java#L106

This does not seem to be consistent with its javadoc, which says it sets the minimum amount of data sent in an RPC
https://github.com/GoogleCloudPlatform/google-cloud-java/blob/master/google-cloud-core/src/main/java/com/google/cloud/WriteChannel.java#L34

With the rounding down, the RPC will actually have less than the minimum. I'm not sure why the rounding to chunk size multiple is needed, but if it can't be removed, it should round up instead of down.

Metadata

Metadata

Assignees

Labels

api: corepriority: p2Moderately-important priority. Fix may not be included in next release.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions