arina-ielchiieva 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_r268515281
##########
File path:
exec/java-exec/src/main/java/org/apache/drill/exec/store/pcap/decoder/Packet.java
##########
@@ -324,7 +333,12 @@ 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) {
+ isCorrupt = true;
+ logger.info("Error while parsing PCAP data: ", e.getMessage());
Review comment:
I think log info will produce error for each corrupt row and log file can
grow enormously. I guess this should be debug, you can also include trace for
the full exception:
```
String message = "Error while parsing PCAP data: ";
logger.debug(message, e.getMessage());
logger.trace(message, e);
```
----------------------------------------------------------------
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