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

fix(unchunker): initial allowed message size to env var #158

Merged
merged 2 commits into from
May 20, 2024

Conversation

kliment-slice
Copy link
Contributor

When sending a JWT token along with a message, this size ends up too small and results in a ValueError. This PR increases max_message_size to 3000 to accommodate.

fix #157

@jourdain
Copy link
Collaborator

While I'm not against bumping that initial message size, I want to make sure it is actually needed (see my comment on the issue).

Also can you reword your commit so it could trigger a new release/change log accordingly.

fix(unchunker): increase initial allowed message size

@@ -87,7 +87,7 @@ class UnChunker:

def __init__(self):
self.pending_messages = {}
self.max_message_size = 512
self.max_message_size = 3000
Copy link
Collaborator

Choose a reason for hiding this comment

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

can we replace that with the following instead? (also add import os at the top)

def __init__(self):
   self.pending_messages = {}
   self.max_message_size = int(os.environ.get("WSLINK_AUTH_MSG_SIZE", 512))

Copy link
Collaborator

Choose a reason for hiding this comment

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

That way, for your usecase, you just need to set that ENV variable to your expected size.

@kliment-slice kliment-slice changed the title increase max_message_size fix(unchunker): initial allowed message size to env var May 20, 2024
@jourdain
Copy link
Collaborator

Thanks for the change but since your commit message does not respect semantic release, I can not merge it. If I were to merge it as-is, no release will be created (and the point of your PR will be lost).

@jourdain
Copy link
Collaborator

I guess I'll squash your changes and rewrite your commit. (I always forgot that I can simply do it via github...)

@jourdain jourdain merged commit 488d637 into Kitware:master May 20, 2024
6 checks passed
github-actions bot pushed a commit that referenced this pull request May 20, 2024
## [2.0.3](v2.0.2...v2.0.3) (2024-05-20)

### Bug Fixes

* **unchunker:** initial allowed message size to env var ([#158](#158)) ([488d637](488d637))
@jourdain
Copy link
Collaborator

🎉 This PR is included in version 2.0.3 🎉

The release is available on:

Your semantic-release bot 📦🚀

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

Successfully merging this pull request may close these issues.

Increase max message size restriction
2 participants