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

Cast the timeout when fetching from JetStream #145

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

jmdeldin
Copy link

We control our timeout via environment variables (worse – YAML) and had a silly bug in our code where the timeout was sent as a string. We kept running out of memory because the expires line was copying our string ("5") one billion times. D'oh!

This is just a simple fix to save new users like us some hassle.

I did run the js_spec.rb with this change, but I wasn't sure the preferred way (if any) of adding a test like this.

For others, this is what I did for a local Docker development setup:

# I added the base64 gem to the gemspec. I'm using Ruby 3.4-rc because concurrent ruby segfaults in 3.3.0.
% docker run -it -v $(pwd):/opt/app ruby:3.4-rc bash 
% bash ./scripts/install_nats.sh
% export PATH=$HOME/nats-server:$PATH
% nats-server &
% bundle install
% bundle exec rspec spec/js_spec.rb

We control our timeout via environment variables and had a silly bug in our code where the timeout was sent as a string. We kept running out of memory because the expires line was copying our string ("5") one billion times.

This is just a simple fix to save new users some hassle.
Copy link
Member

@wallyqs wallyqs left a comment

Choose a reason for hiding this comment

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

LGTM

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

Successfully merging this pull request may close these issues.

2 participants