Skip to content

Request Content length is unavailable until after last chunk is received #106

@rabeyta

Description

@rabeyta

Currently, when logging errors around requests not being completed, such as Incomplete Http Call Timeouts, the content length that is logged is always 0.

This is expected behavior based on java docs:

/**
* Returns the total size of the raw content in bytes. This will be 0 until {@link #addContentChunk(HttpContent)}
* detects that the final content chunk has been added, at which point this method will return the number of bytes
* for the request content. You can call {@link #isCompleteRequestWithAllChunks()} to determine whether this method
* is returning 0 because we're waiting on all the content to finish arriving or because the request has no content
* associated with it.
*/
public int getRawContentLengthInBytes();

and implementation at

public synchronized int getRawContentLengthInBytes() {
if (!isCompleteRequestWithAllChunks)
return 0;
return rawContentLengthInBytes;
}

It is coded to return 0 until the request is completed.

Enabling a method to get the current request size in these error scenarios would be helpful and provide insights.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions