Skip to content

Commit

Permalink
Merge pull request #1 from vitalik-dj/fix_#88_Failed_to_handshake_error
Browse files Browse the repository at this point in the history
Fix logstash-plugins#88 failed to handshake error and publish version 3.1.8
  • Loading branch information
vitalik-dj authored Apr 22, 2024
2 parents 61e9330 + f9093e2 commit 2840fb3
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 9 deletions.
4 changes: 3 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
## #unreleased
## 3.1.8
- Fix tests failture for ELASTIC_STACK_VERSION=8.x. Fail message: undefined method `validating_keys?' for BSON::Config:Module
- Fix MongoDB connection error - Failed to handshake [#88] https://github.com/logstash-plugins/logstash-output-mongodb/issues/88
- Fix: Fix failing test spec on jruby-9.3.4.0 [#81](https://github.com/logstash-plugins/logstash-output-mongodb/pull/81)

## 3.1.7
Expand Down
1 change: 1 addition & 0 deletions CONTRIBUTORS
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ Contributors:
* bitsofinfo (bitsofinfo)
* Guy Boertje (guyboertje)
* Colin Surprenant (colinsurprenant)
* Vitalii Zavadovskyy

Note: If you've sent us patches, bug reports, or otherwise contributed to
Logstash, and you aren't on the list above and want to be, please let us know
Expand Down
6 changes: 3 additions & 3 deletions lib/logstash/outputs/bson/big_decimal.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ module BigDecimal
# 1.221311.to_bson
# @return [ String ] The encoded string.
# @see http://bsonspec.org/#/specification
def to_bson(buffer = ByteBuffer.new, validating_keys = Config.validating_keys?)
buffer.put_bytes([ self ].pack(PACK))
def to_bson(buffer = ByteBuffer.new, _validating_keys = nil)
buffer.put_bytes([ self ].pack(PACK))
end

module ClassMethods
Expand All @@ -43,7 +43,7 @@ module ClassMethods
# @param [ BSON ] bson object from Mongo.
# @return [ BigDecimal ] The decoded BigDecimal.
# @see http://bsonspec.org/#/specification
def from_bson(bson)
def from_bson(bson, **_options)
from_bson_double(bson.get_bytes(8))
end

Expand Down
4 changes: 2 additions & 2 deletions lib/logstash/outputs/bson/logstash_event.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ module LogStashEvent
# Event.new("field" => "value").to_bson
# @return [ String ] The encoded string.
# @see http://bsonspec.org/#/specification
def to_bson(buffer = ByteBuffer.new, validating_keys = Config.validating_keys?)
def to_bson(buffer = ByteBuffer.new, _validating_keys = nil)
position = buffer.length
buffer.put_int32(0)
to_hash.each do |field, value|
Expand All @@ -55,7 +55,7 @@ module ClassMethods
# @param [ ByteBuffer ] buffer The byte buffer.
# @return [ Event ] The decoded bson document.
# @see http://bsonspec.org/#/specification
def from_bson(buffer)
def from_bson(buffer, **_options)
hash = Hash.new
buffer.get_int32 # Throw away the size.
while (type = buffer.get_byte) != NULL_BYTE
Expand Down
4 changes: 2 additions & 2 deletions lib/logstash/outputs/bson/logstash_timestamp.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ module LogStashTimestamp
# A time is type 0x09 in the BSON spec.
BSON_TYPE = 9.chr.force_encoding(BINARY).freeze

def to_bson(buffer = ByteBuffer.new, validating_keys = Config.validating_keys?)
def to_bson(buffer = ByteBuffer.new, _validating_keys = nil)
time.to_bson(buffer)
end

Expand All @@ -34,7 +34,7 @@ module ClassMethods
# @param [ BSON ] bson encoded time.
# @return [ ::LogStash::Timestamp ] The decoded UTC time as a ::LogStash::Timestamp.
# @see http://bsonspec.org/#/specification
def from_bson(bson)
def from_bson(bson, **_options)
seconds, fragment = BSON::Int64.from_bson(bson).divmod(1000)
new(::Time.at(seconds, fragment * 1000).utc)
end
Expand Down
2 changes: 1 addition & 1 deletion logstash-output-mongodb.gemspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Gem::Specification.new do |s|
s.name = 'logstash-output-mongodb'
s.version = '3.1.7'
s.version = '3.1.8'
s.licenses = ['Apache License (2.0)']
s.summary = "Writes events to MongoDB"
s.description = "This gem is a Logstash plugin required to be installed on top of the Logstash core pipeline using $LS_HOME/bin/logstash-plugin install gemname. This gem is not a stand-alone program"
Expand Down

0 comments on commit 2840fb3

Please sign in to comment.