send blank message as heartbeat over TCP instead of UDP, when configured... #74

Merged
merged 4 commits into from Jan 31, 2013

Conversation

Projects
None yet
3 participants
Owner

tagomoris commented Nov 8, 2012

To solve issue#73, send TCP blank msgpack tag/event-array as heartbeat

@repeatedly repeatedly and 1 other commented on an outdated diff Nov 8, 2012

lib/fluent/plugin/out_forward.rb
@@ -29,6 +29,15 @@ def initialize
end
config_param :send_timeout, :time, :default => 60
+ config_param :heartbeat, :default => :udp do |val|
+ if val == 'tcp' or val == 'TCP'
@repeatedly

repeatedly Nov 8, 2012

Owner

What do you think following code?

case val.downcase
when 'tcp'
  :tcp
...
@tagomoris

tagomoris Nov 9, 2012

Owner

I see, 'val.downcase' is more simple.

@repeatedly repeatedly commented on an outdated diff Nov 8, 2012

lib/fluent/plugin/out_forward.rb
@@ -29,6 +29,15 @@ def initialize
end
config_param :send_timeout, :time, :default => 60
+ config_param :heartbeat, :default => :udp do |val|
+ if val == 'tcp' or val == 'TCP'
+ :tcp
+ elsif val == 'udp' or val == 'UDP'
+ :udp
+ else
+ rasie ConfigError, "forward output heartbeat type is 'tcp' or 'udp'"

@repeatedly repeatedly and 1 other commented on an outdated diff Nov 10, 2012

lib/fluent/plugin/out_forward.rb
@@ -193,6 +204,21 @@ def rebuild_weight_array
# MessagePack FixArray length = 2
FORWARD_HEADER = [0x92].pack('C')
+ FORWARD_TCP_HEARTBEAT_DATA = FORWARD_HEADER + ''.to_msgpack + MessagePack.pack([])
@repeatedly

repeatedly Nov 10, 2012

Owner

Why do you use two pack methods, to_msgpack and MessagePack.pack?

@tagomoris

tagomoris Nov 10, 2012

Owner

Maybe, these are result of copy&paste from other lines..... I'll fix it.

Owner

tagomoris commented Dec 4, 2012

Modify branch as:

  • rebase from HEAD (IPv6 support)
  • fix in_forward not to emit blank tag-and-message (assumed as tcp heartbeat)
Owner

repeatedly commented Dec 4, 2012

How's your fluentd cluster going?

Owner

tagomoris commented Dec 4, 2012

Now (this 5 hours), all of our fluentd (124) processes with 'heartbeat tcp' option, seems to be working well...

frsyuki referenced this pull request Dec 7, 2012

Closed

tcp heartbeat #91

Owner

frsyuki commented Dec 7, 2012

This change has a backward compatibility problem...
Could you see this change?: #91

Owner

repeatedly commented Jan 31, 2013

Okay. I merge this pull request soon.

@repeatedly repeatedly merged commit 68fe451 into fluent:master Jan 31, 2013

Owner

tagomoris commented Jan 31, 2013

👍

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