0

Our Azure file share mounted on pods using like this

We are a seeing stale NFS file-handle on one specific file can we every time we ask our program to create and write that file we are seeing the program terminate reporting us stale NFS file handle

But creating the file using the UNIX utility echo "hello" > the-file.txt on the mounted file share seems to work.

What is the problem here? All the other files are getting created except this one file.

The relevant code is in golang and it look like this.

    ...
    s.csvFile, err = snowflakeFile(filePath, data)
    if err != nil {
        return err
    }
    defer s.cleanup()
    ...
func snowflakeFile(path string, data EventData) (*os.File, error) {
    filename := fmt.Sprintf("%s-%s-%s.csv", data.Type, md5Sum(data.RemoteServer), filepath.Base(path))
    filename = filepath.Join(config.Fetch("CSV_DIR"), filename)
    return os.OpenFile(filename, os.O_CREATE|os.O_WRONLY|os.O_TRUNC, 0644)
}
func (b *base) cleanup() error {
    err := b.csvFile.Close()
    if err != nil {
        log.Errorf("[%s] Error closing the file handler %s: %+v", b.Type, b.csvFile.Name(), err)
    }
    return err
}
Viren
  • 171
  • 1
  • 2
  • 10

0 Answers0