franz 1.4.28 → 1.4.29

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/VERSION +1 -1
  3. data/lib/franz/tail.rb +7 -6
  4. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 5919d12a8ec25311968f91df0e4534fffbce835d
4
- data.tar.gz: 73e7dc15882ab7ece07a0edb07dcfb8e4c3bc276
3
+ metadata.gz: f6cfe7cf2f168b1136034b8a334257ca154ce17c
4
+ data.tar.gz: e548cdc11eac8e9b0783ef3851b51dc0ec935e47
5
5
  SHA512:
6
- metadata.gz: 8dfb65250f7ceb502c3c729d83e6500b7fd6f10726726a530872c9b48a870a7c3397a12d5104c09a2201684e1aacda484f61d328ceea006e22f4d7dcddd16c90
7
- data.tar.gz: e0b026e3ff841e04f8b866243b7591fd82f35da9ea7dc56e9c0cd2663fb402a86ee1440182db99fe9f5edfc93cf26f70ae2441b2b13646a4072f84eb99ac503c
6
+ metadata.gz: 8cc4948673bdf8c1a77baf2ae2c55e1b99f64dc3d4a45c52380760da2f03514637dff88e6076fdb8e97d3f99613c2aafc0aba0ab321903c74558c1a286e920fb
7
+ data.tar.gz: d1c36f6c335b5108f522bce53a884fd1e689081e74c46176cb7f316e0821468ff32e01db6d43c0848329f99cfc9b9a6ac119d3e39bb910dad9e7184fd7623fb9
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.4.28
1
+ 1.4.29
data/lib/franz/tail.rb CHANGED
@@ -89,15 +89,19 @@ module Franz
89
89
  next
90
90
  end
91
91
 
92
+ # Handle issue with IO::read, which seems to return nil when
93
+ # the file in question has been rotated. In such a case, we'll
94
+ # just reset the cursor and bail; hopefully we'll get a
95
+ # "rotated" event from Watch in the near future.
92
96
  if data.nil?
93
- log.fatal \
97
+ log.warn \
94
98
  event: 'nil read',
95
99
  path: path,
96
100
  size: size,
97
101
  cursor: @cursors[path],
98
102
  spread: (size - @cursors[path])
99
- exit 2
100
- raise 'nil read'
103
+ @cursors[path] = 0
104
+ return
101
105
  end
102
106
  size = data.bytesize
103
107
 
@@ -113,7 +117,6 @@ module Franz
113
117
  cursor: @cursors[path],
114
118
  spread: (size - @cursors[path])
115
119
  exit 2
116
- raise 'buffer full'
117
120
  end
118
121
 
119
122
  @cursors[path] += size
@@ -127,7 +130,6 @@ module Franz
127
130
  cursor: @cursors[path],
128
131
  spread: (size - @cursors[path])
129
132
  exit 2
130
- raise 'incomplete read'
131
133
  end
132
134
  end
133
135
 
@@ -158,7 +160,6 @@ module Franz
158
160
  else
159
161
  log.fatal event: 'invalid event', raw: event
160
162
  exit 2
161
- raise 'invalid event'
162
163
  end
163
164
  return event[:path]
164
165
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: franz
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.28
4
+ version: 1.4.29
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sean Clemmer