more common errors

This commit is contained in:
Alex Grintsvayg 2018-09-26 16:00:19 -04:00
parent 747a6ec2b2
commit 686ac662cc
2 changed files with 6 additions and 0 deletions

View file

@ -416,6 +416,8 @@ func execTx(tx *sql.Tx, query string, args ...interface{}) error {
/* SQL schema
in prod, set tx_isolation to READ-COMMITTED to improve db performance
CREATE TABLE blob_ (
hash char(96) NOT NULL,
is_stored TINYINT(1) NOT NULL DEFAULT 0,

View file

@ -69,6 +69,10 @@ func (s *stats) AddError(e error) (shouldLog bool) { // shouldLog is a hack, but
name = "i/o timeout"
} else if strings.Contains(err.Error(), "read: connection reset by peer") {
name = "read conn reset"
} else if strings.Contains(err.Error(), "unexpected EOF") {
name = "unexpected EOF"
} else if strings.Contains(err.Error(), "write: broken pipe") {
name = "write broken pipe"
} else {
shouldLog = true
}