summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorColin Marc <hi@colinmarc.com>2022-02-05 14:05:57 +0100
committerColin Marc <hi@colinmarc.com>2022-02-05 14:05:57 +0100
commit65f451654ba5fcc930aa9acdb5826affd19fc7eb (patch)
treed4a34dbea064f836957958a54069d9c4c256bd45
parent19e9639f12c882075cc2665cde964b11cf54f350 (diff)
Revert "Check that closing a file after writing actually succeeds"
This reverts commit 19e9639f12c882075cc2665cde964b11cf54f350.
-rw-r--r--file_writer.go3
-rw-r--r--hadoopconf/hadoopconf.go2
-rw-r--r--internal/transfer/block_write_stream.go2
3 files changed, 2 insertions, 5 deletions
diff --git a/file_writer.go b/file_writer.go
index a773732..6b609f4 100644
--- a/file_writer.go
+++ b/file_writer.go
@@ -1,7 +1,6 @@
package hdfs
import (
- "errors"
"io"
"os"
"time"
@@ -240,8 +239,6 @@ func (f *FileWriter) Close() error {
err := f.client.namenode.Execute("complete", completeReq, completeResp)
if err != nil {
return &os.PathError{"create", f.name, err}
- } else if !completeResp.GetResult() {
- return &os.PathError{"create", f.name, errors.New("failed to close file")}
}
return nil
diff --git a/hadoopconf/hadoopconf.go b/hadoopconf/hadoopconf.go
index 9bc6db1..f9a6fc2 100644
--- a/hadoopconf/hadoopconf.go
+++ b/hadoopconf/hadoopconf.go
@@ -123,7 +123,7 @@ func (conf HadoopConf) Namenodes() []string {
}
keys := make([]string, 0, len(nns))
- for k := range nns {
+ for k, _ := range nns {
keys = append(keys, k)
}
diff --git a/internal/transfer/block_write_stream.go b/internal/transfer/block_write_stream.go
index 752caeb..0f47cb0 100644
--- a/internal/transfer/block_write_stream.go
+++ b/internal/transfer/block_write_stream.go
@@ -290,7 +290,7 @@ Acks:
// Once we've seen an error, just keep reading packets off the channel (but
// not off the socket) until the writing thread figures it out. If we don't,
// the upstream thread could deadlock waiting for the channel to have space.
- for range s.packets {
+ for _ = range s.packets {
}
}