db480e6e1b
This change fixes two things which can make reading from a corrupted orders file inefficient. * When a corrupted order is detected, but the underlying error is an UnexpectedEOF (as opposed to a pb.Unmarshal error, for instance), there is no point in attempting to read from the file another time to find an additional uncorrupted order - we will continue to get UnexpectedEOF errors until we seek to the very end of the file and get a normal EOF. Instead, when UnexpectedEOF occurs, log and send metrics as with other types of corruption, but do not attempt to read again. * When a corrupted order is detected, instead of seeking forward only one byte for the next attempt, seek forward by the size of entryHeader. This cuts down on the number of iterations needed to find an uncorrupted order after detecting a corrupted one. Change-Id: Ie1a613127e29d29318584ec7f60e8f7554f73487 |
||
---|---|---|
.. | ||
common.go | ||
v0.go | ||
v1.go |