Skip to content

Commit

Permalink
Log cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
kpjensen committed Sep 23, 2021
1 parent fef7a1d commit ab068fb
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 6 deletions.
1 change: 0 additions & 1 deletion cli/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,6 @@ func fsDaemon(
// By default fuse will use 128kb read-ahead even though we ask for 1024kb
// If running as root on linux, raise read-ahead to 1024kb after mounting
if user.Uid == "0" && runtime.GOOS == "linux" {
logger.Printf("Setting kernel read-ahead for dxfuse to 1024kb")
mntInfo, err := os.Stat(mountpoint)
if err != nil {
logger.Printf(err.Error())
Expand Down
1 change: 1 addition & 0 deletions dx_ops.go
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,7 @@ func (ops *DxOps) DxFileCloseAndWait(
switch fDesc.State {
case "closed":
// done. File is closed.
ops.log("Closed %s:%s", projectId, fid)
return nil
case "closing":
// not done yet.
Expand Down
9 changes: 5 additions & 4 deletions dxfuse.go
Original file line number Diff line number Diff line change
Expand Up @@ -1092,11 +1092,12 @@ func (fsys *Filesys) Unlink(ctx context.Context, op *fuseops.UnlinkOp) error {
objectIds := make([]string, 1)
objectIds[0] = fileToRemove.Id
if err := fsys.ops.DxRemoveObjects(ctx, oph.httpClient, parentDir.ProjId, objectIds); err != nil {
fsys.log("Error in removing file (%s:%s/%s) on dnanexus: %s",
fsys.log("Error in removing %s:%s%s on dnanexus: %s",
parentDir.ProjId, parentDir.ProjFolder, op.Name,
err.Error())
return fsys.translateError(err)
}
fsys.log("Removed %s, %s:%s%s", op.Name, parentDir.ProjId, parentDir.ProjFolder, op.Name)

return nil
}
Expand Down Expand Up @@ -1577,8 +1578,6 @@ func (fsys *Filesys) WriteFile(ctx context.Context, op *fuseops.WriteFileOp) err
fsys.opClose(oph)
fsys.mutex.Unlock()
fh.writeBuffer = fsys.uploader.AllocateWriteBuffer(partId, false)
fsys.log("allocated wb for %s", fh.Id)

}
// all data copied into buffer slice, break
if bytesCopied == len(bytesToWrite) {
Expand Down Expand Up @@ -1729,7 +1728,9 @@ func (fsys *Filesys) ReleaseFileHandle(ctx context.Context, op *fuseops.ReleaseF
case AM_AO_Remote:
// Special case for empty files which are not uploaded during FlushFile since their size is 0
if fh.size == 0 && len(fh.writeBuffer) == 0 && fh.lastPartId == 0 {
fsys.log("Upload and close empty file")
if fsys.ops.options.Verbose {
fsys.log("Upload and close empty %s", fh.Id)
}
fh.lastPartId++
partId := fh.lastPartId
httpClient := <-fsys.httpClientPool
Expand Down
4 changes: 3 additions & 1 deletion metadata_db.go
Original file line number Diff line number Diff line change
Expand Up @@ -1251,7 +1251,7 @@ func (mdb *MetadataDb) CreateFile(
mode os.FileMode) (File, error) {
if mdb.options.Verbose {
mdb.log("CreateFile %s/%s projpath=%s%s",
dir.FullPath, fname, dir.ProjFolder, dir.ProjId)
dir.FullPath, fname, dir.ProjId, dir.ProjFolder)
}

// Create remote file
Expand Down Expand Up @@ -1292,6 +1292,8 @@ func (mdb *MetadataDb) CreateFile(
mdb.log("CreateFile error creating data object")
return File{}, err
}
mdb.log("Created file %s/%s %s:%s",
dir.FullPath, fname, dir.ProjId, fileId)

// 3. return a File structure
return File{
Expand Down

0 comments on commit ab068fb

Please sign in to comment.