Project

General

Profile

Bug #12247

Updated by Tom Clegg about 5 years ago

Reported on mailing list: 

 <pre> 
 Sep 13 11:21:12 arvados keepproxy: 2017/09/13 11:21:12 128.248.171.19,172.17.0.231:52236 GET /fe194b0a4576d5c8d9d0a2055b132b60+67108864+Ab7cbd46f674287a7e906d009c18227475a83edbb@59cbcfe9 200 67108864 34647446 http://arvados-keep01.cri.local:25107/fe194b0a4576d5c8d9d0a2055b132b60+67108864+Ab7cbd46f674287a7e906d009c18227475a83edbb@59cbcfe9 Reader failed checksum 
 Sep 13 11:21:29 arvados keepproxy: 2017/09/13 11:21:29 128.248.171.19,172.17.0.231:51688 GET /fe194b0a4576d5c8d9d0a2055b132b60+67108864+Ab7cbd46f674287a7e906d009c18227475a83edbb@59cbcfe9 200 67108864 30612102 http://arvados-keep01.cri.local:25107/fe194b0a4576d5c8d9d0a2055b132b60+67108864+Ab7cbd46f674287a7e906d009c18227475a83edbb@59cbcfe9 Reader failed checksum 
 Sep 13 11:21:44 arvados keepproxy: 2017/09/13 11:21:44 128.248.171.19,172.17.0.231:50472 GET /fe194b0a4576d5c8d9d0a2055b132b60+67108864+Ab7cbd46f674287a7e906d009c18227475a83edbb@59cbcfe9 200 67108864 34956478 http://arvados-keep01.cri.local:25107/fe194b0a4576d5c8d9d0a2055b132b60+67108864+Ab7cbd46f674287a7e906d009c18227475a83edbb@59cbcfe9 Reader failed checksum 
 Sep 13 11:22:00 arvados keepproxy: 2017/09/13 11:22:00 128.248.171.19,172.17.0.231:52286 GET /fe194b0a4576d5c8d9d0a2055b132b60+67108864+Ab7cbd46f674287a7e906d009c18227475a83edbb@59cbcfe9 200 67108864 63292254 http://arvados-keep01.cri.local:25107/fe194b0a4576d5c8d9d0a2055b132b60+67108864+Ab7cbd46f674287a7e906d009c18227475a83edbb@59cbcfe9 Reader failed checksum 
 </pre> 

 The corresponding keepstore logs indicated everything was fine. 

 Suspect the following code in source:sdk/go/keepclient/hashcheck.go: 

 <pre><code class="go"> 
 func (this HashCheckingReader) WriteTo(dest io.Writer) (written int64, err error) { 
	 if writeto, ok := this.Reader.(io.WriterTo); ok { 
		 written, err = writeto.WriteTo(io.MultiWriter(dest, this.Hash)) 
	 } else { 
		 written, err = io.Copy(io.MultiWriter(dest, this.Hash), this.Reader) 
	 } 

	 sum := this.Hash.Sum(make([]byte, 0, this.Hash.Size())) 

	 if fmt.Sprintf("%x", sum) != this.Check { 
		 err = BadChecksum 
	 } 
 </pre> 

 If io.Copy returned a non-nil error, then we should return that error and skip the hash check, like we do in Read(). 

 I expect the resulting log message will be something like "write to closed socket", which would be a much better clue that the problem (if any) is just about sending the response to this particular request, and there's no reason to suspect data corruption. 

Back