cgivre commented on a change in pull request #1637: DRILL-7032: Ignore corrupt
rows in a PCAP file
URL: https://github.com/apache/drill/pull/1637#discussion_r267160182
##########
File path:
exec/java-exec/src/main/java/org/apache/drill/exec/store/pcap/decoder/Packet.java
##########
@@ -324,7 +329,11 @@ public int getDst_port() {
byte[] data = null;
if (packetLength >= payloadDataStart) {
data = new byte[packetLength - payloadDataStart];
- System.arraycopy(raw, ipOffset + payloadDataStart, data, 0, data.length);
+ try {
+ System.arraycopy(raw, ipOffset + payloadDataStart, data, 0,
data.length);
+ } catch (Exception e) {
Review comment:
Hi @arina-ielchiieva
I didn't have a lot of test data to work with, but I do think it would be
worth logging the exception. My general approach was to be as broad as
possible so that any parsing error would be caught and the packet would be
flagged as corrupt.
I'll add a logging statement.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services