Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions pkg/filesystem/vnode/tasks.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import (
)

const tasksCacheTTL = 5 * time.Second
const taskFileSentinelSize int64 = 10 << 20 // 10MB — must be large enough for FUSE/NFS to issue reads covering all content
Copy link
Copy Markdown

@cubic-dev-ai cubic-dev-ai bot Feb 12, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2: The fixed 10MB sentinel size can truncate task logs larger than 10MB because the file size advertised by Getattr/Readdir is smaller than the actual content returned by Read. Use a size that’s guaranteed to be >= the maximum possible log size (or compute the size from actual content) to avoid clients stopping early.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At pkg/filesystem/vnode/tasks.go, line 20:

<comment>The fixed 10MB sentinel size can truncate task logs larger than 10MB because the file size advertised by Getattr/Readdir is smaller than the actual content returned by Read. Use a size that’s guaranteed to be >= the maximum possible log size (or compute the size from actual content) to avoid clients stopping early.</comment>

<file context>
@@ -17,6 +17,7 @@ import (
 )
 
 const tasksCacheTTL = 5 * time.Second
+const taskFileSentinelSize int64 = 10 << 20 // 10MB — must be large enough for FUSE/NFS to issue reads covering all content
 
 // TasksVNode provides /tasks directory listing tasks as files.
</file context>
Fix with Cubic

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We may be able to (when listing metadata), get more accurate size values from s2 to avoid this hack. Worth a shot.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the feedback! I've saved this as a new learning to improve future reviews.


// TasksVNode provides /tasks directory listing tasks as files.
// Each task appears as a file named {task_id}.task
Expand Down Expand Up @@ -301,7 +302,7 @@ func (t *TasksVNode) Getattr(path string) (*FileInfo, error) {
}

// Task file - return file info
info := NewFileInfo(PathIno(path), 0, 0644)
info := NewFileInfo(PathIno(path), taskFileSentinelSize, 0644)
if task.CreatedAt.Unix() > 0 {
info.Mtime = task.CreatedAt
info.Ctime = task.CreatedAt
Expand Down Expand Up @@ -331,7 +332,7 @@ func (t *TasksVNode) Readdir(path string) ([]DirEntry, error) {
Name: name,
Mode: syscall.S_IFREG | 0644,
Ino: PathIno(TasksPath + "/" + name),
Size: 0, // Size unknown until read
Size: taskFileSentinelSize,
Mtime: mtime,
})
}
Expand Down
Loading