Skip to content

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

Merged
merged 4 commits into from Jan 31, 2013

3 participants

@tagomoris
Fluentd: Unified Logging Layer member

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
Fluentd: Unified Logging Layer member
repeatedly added a note Nov 8, 2012

What do you think following code?

case val.downcase
when 'tcp'
  :tcp
...
@tagomoris
Fluentd: Unified Logging Layer member
tagomoris added a note Nov 9, 2012

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
@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
Fluentd: Unified Logging Layer member
repeatedly added a note Nov 8, 2012

typo

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
@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
Fluentd: Unified Logging Layer member
repeatedly added a note Nov 10, 2012

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

@tagomoris
Fluentd: Unified Logging Layer member
tagomoris added a note Nov 10, 2012

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
@tagomoris
Fluentd: Unified Logging Layer member

Modify branch as:

  • rebase from HEAD (IPv6 support)
  • fix in_forward not to emit blank tag-and-message (assumed as tcp heartbeat)
@repeatedly
Fluentd: Unified Logging Layer member

How's your fluentd cluster going?

@tagomoris
Fluentd: Unified Logging Layer member

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

@frsyuki frsyuki referenced this pull request Dec 7, 2012
Closed

tcp heartbeat #91

@frsyuki
Fluentd: Unified Logging Layer member
frsyuki commented Dec 7, 2012

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

@repeatedly
Fluentd: Unified Logging Layer member

Okay. I merge this pull request soon.

@repeatedly repeatedly merged commit 68fe451 into fluent:master Jan 31, 2013
@tagomoris
Fluentd: Unified Logging Layer member

👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.