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

batch logging should watch the resulting batch payload size #179

Closed
rplevka opened this issue Apr 22, 2022 · 1 comment
Closed

batch logging should watch the resulting batch payload size #179

rplevka opened this issue Apr 22, 2022 · 1 comment
Milestone

Comments

@rplevka
Copy link
Contributor

rplevka commented Apr 22, 2022

Describe the bug
We currently only issue the batch logging after the configured batch_log_size is about to be exceeded.
https://github.com/reportportal/client-Python/blob/master/reportportal_client/core/log_manager.py#L72

This method also needs to watch the current batch payload size, as RP server refuses requests that exceed the pre-configured maximum payload size:

ResponseError(error_messages[0])
16:10:24  reportportal_client.errors.ResponseError: 5000: Unclassified error [Maximum upload size of 67108864 bytes exceeded; nested exception is org.apache.commons.fileupload.FileUploadBase$FileSizeLimitExceededException: The field json_request_part exceeds its maximum permitted size of 67108864 bytes.]

Steps to Reproduce
Steps to reproduce the behavior:

  1. either set the log_batch_size to a really high value and try to log a lot of messages or try to log a really long message (tl;dr generate a payload larger than a max allowed payload size on a server - default is probably 67108864 bytes)

Expected behavior

  • implement configurable parameter: log_batch_payload_size.

  • _log_process function should watch this and "flush" (send) the batch before appending another log message in case the payload is about to be exceeded.

  • Figure out a sane way of handling a single log that itself exceeds the limit - maybe some string-splitting strategy could apply with a WARNING message being logged.

Actual behavior
the client crashes with raising the ResponseError

Package versions
5.2.0

@rplevka rplevka added the bug label Apr 22, 2022
@HardNorth HardNorth added enhancement and removed bug labels Apr 27, 2022
@HardNorth HardNorth added this to the 5.3 milestone Apr 27, 2022
@HardNorth
Copy link
Member

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants