-
Notifications
You must be signed in to change notification settings - Fork 1
Merge our changes into updated master branch #2
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
base: master
Are you sure you want to change the base?
Changes from all commits
d98433e
b2e9ff6
e3bcc11
0523301
115833c
9b45dbb
c302ef1
0c8cd3f
aa43ff4
bf2e2fe
156d682
929f276
cbbf32f
ae88877
33e0d7c
cdb7213
23a8f75
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||
|---|---|---|---|---|
|
|
@@ -206,14 +206,18 @@ def produce(value, key: nil, headers: {}, topic:, partition: nil, partition_key: | |||
| create_time: create_time | ||||
| )) | ||||
|
|
||||
| if message.bytesize >= @max_buffer_bytesize | ||||
| buffer_overflow topic, "Message is too big: message_bytesize=#{message.bytesize}" | ||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @yboulkaid where is
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It's defined in the ruby-kafka/lib/kafka/async_producer.rb Line 182 in b9b1cdf
This is the helper method that's used by the rest of the class to raise |
||||
| end | ||||
|
|
||||
| if buffer_size >= @max_buffer_size | ||||
| buffer_overflow topic, | ||||
| "Cannot produce to #{topic}, max buffer size (#{@max_buffer_size} messages) reached" | ||||
| "Cannot produce to #{topic}, max buffer size (#{@max_buffer_size} messages) reached (buffer_size: #{buffer_size})" | ||||
| end | ||||
|
|
||||
| if buffer_bytesize + message.bytesize >= @max_buffer_bytesize | ||||
| buffer_overflow topic, | ||||
| "Cannot produce to #{topic}, max buffer bytesize (#{@max_buffer_bytesize} bytes) reached" | ||||
| "Cannot produce to #{topic}, max buffer bytesize (#{@max_buffer_bytesize} bytes) reached (buffer_bytesize: #{buffer_bytesize}, message_bytesize: #{message.bytesize})" | ||||
| end | ||||
|
|
||||
| # If the producer is in transactional mode, all the message production | ||||
|
|
@@ -521,6 +525,7 @@ def buffer_overflow(topic, message) | |||
| @instrumenter.instrument("buffer_overflow.producer", { | ||||
| topic: topic, | ||||
| }) | ||||
| @logger.error "producer.buffer_overflow: topic:#{topic}, message:#{message}" | ||||
|
|
||||
| raise BufferOverflow, message | ||||
| end | ||||
|
|
||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -41,7 +41,7 @@ def clear_tags! | |
| def current_tags | ||
| # We use our object ID here to avoid conflicting with other instances | ||
| thread_key = @thread_key ||= "kafka_tagged_logging_tags:#{object_id}".freeze | ||
| Thread.current[thread_key] ||= [] | ||
| Thread.current[thread_key] ||= ["ruby-kafka"] | ||
|
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
| end | ||
|
|
||
| def tags_text | ||
|
|
||

There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These checks were in our fork but not in the official version. We backport them to keep existing behavior.