Skip to content

Commit bcc449e

Browse files
committed
in_tail: reduce the survival time of the buffer area
1 parent 5080f81 commit bcc449e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/fluent/plugin/in_tail.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1119,7 +1119,6 @@ def initialize(watcher, path:, read_lines_limit:, read_bytes_limit_per_second:,
11191119
@receive_lines = receive_lines
11201120
@open_on_every_update = open_on_every_update
11211121
@fifo = FIFO.new(from_encoding || Encoding::ASCII_8BIT, encoding || Encoding::ASCII_8BIT, log, max_line_size)
1122-
@iobuf = ''.force_encoding('ASCII-8BIT')
11231122
@lines = []
11241123
@io = nil
11251124
@notify_mutex = Mutex.new
@@ -1201,6 +1200,7 @@ def handle_notify
12011200
end
12021201

12031202
with_io do |io|
1203+
iobuf = ''.force_encoding('ASCII-8BIT')
12041204
begin
12051205
read_more = false
12061206
has_skipped_line = false
@@ -1211,7 +1211,7 @@ def handle_notify
12111211
@start_reading_time ||= Fluent::Clock.now
12121212
group_watcher&.update_reading_time(@path)
12131213

1214-
data = io.readpartial(BYTES_TO_READ, @iobuf)
1214+
data = io.readpartial(BYTES_TO_READ, iobuf)
12151215
@eof = false
12161216
@number_bytes_read += data.bytesize
12171217
@fifo << data

0 commit comments

Comments
 (0)