Ticket #216 (new enhancement)

Opened 7 years ago

Winston: patch to the patch for rename/copy channel data

Reported by: Philip Crotwell Owned by: somebody
Priority: minor Milestone: All Platforms
Component: ALL modules Version: 7.6
Keywords: Cc:


So I found an issue with the code I sent you before. [previous code was discussed with Tom Parker 8/4/2011; not sure it got added] Apparently it is possible to end up with traceBufs in the database that can't be decompressed. I suspect this was due to a disk that filled here a while back, but it seems that somehow bad data got into the database. When running my copier, I got this:

java.util.zip.DataFormatException?: incomplete distance tree

at java.util.zip.Inflater.inflateBytes(Native Method) at java.util.zip.Inflater.inflate(Inflater.java:238) at java.util.zip.Inflater.inflate(Inflater.java:256) at gov.usgs.util.Util.decompress(Util.java:731) at gov.usgs.winston.db.Data.getTraceBufBytes(Data.java:440) at gov.usgs.winston.db.Admin.copyChannel(Admin.java:186) at gov.usgs.winston.db.Admin.main(Admin.java:427)

2012-04-18 13:04:26: (SEVERE) Error during renameChannel(BIRD$BHE$CO$00, BIRD$HHE$CO$00).

------- Exception: java.lang.NullPointerException?/null

---- Stack Trace: gov.usgs.winston.db.Admin.copyChannel/Admin.java:187 ---- Stack Trace: gov.usgs.winston.db.Admin.main/Admin.java:427

The patch I have attached checks for null and skips the traceBuf (with a warning message) if it is null.

Also, in the "huh???" catagory, there is code in gov.usgs.util.Util (line 749-752) that does this. Pretty piss poor code style IMHO, especially since this method seems to be called exactly once, and surely the exception could be handled in the calling method. Basically my bug would not have happened had the exception not been prematurely caught. Grumble grumble...

catch (Exception e) {


} return null;

Anyway, I did the patch including the previous change as well as it looks like my prior patch has not been added to the svn tree. Any ideas of if it will be? It is ok either way, but I am less likely to submit additional patches if they are going to be ignored. Not really griping, just curious if you know whether it is worth the effort on my part. I would prefer to not pay the stupid tax, but...

The change is line 187-190:

if (bytes == null) {

winston.getLogger().warning("Unable to decompress a traceBuf in "+chTable+", skipping: "); continue;


Thanks Philip


copyChannel2.patch (5.3 KB) - added by stefan 7 years ago.

Change History

Changed 7 years ago by stefan

Note: See TracTickets for help on using tickets.