Skip to content

Commit

Permalink
fix possible over size exception when batch udp
Browse files Browse the repository at this point in the history
Motivation:

UDP package size should <= 64K, So if we enable batch for write points
by UDP. it may involved the IO exception when we batch write too many
points:

"java.io.IOException: Message too long
"

Modifications:

write directly without batch for udp in batch processor.

Result:

1 avoid over size exception. If the exception occur. use should limit
point's content.
  • Loading branch information
jiafu1115 committed Nov 22, 2016
1 parent 892ba94 commit 3817c62
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/main/java/org/influxdb/impl/BatchProcessor.java
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,9 @@ void write() {
BatchProcessor.this.influxDB.write(batchPoints);
}
for (Entry<Integer, List<String>> entry : udpPortToBatchPoints.entrySet()) {
BatchProcessor.this.influxDB.write(entry.getKey(), entry.getValue());
for (String lineprotocolStr : entry.getValue()) {
BatchProcessor.this.influxDB.write(entry.getKey(), lineprotocolStr);
}
}
} catch (Throwable t) {
// any exception wouldn't stop the scheduler
Expand Down

0 comments on commit 3817c62

Please sign in to comment.