Skip to content

Commit aa72760

Browse files
committed
chore: add file descriptor limit info to support bundle
1 parent 808fb78 commit aa72760

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

SushitrainCore/src/sushitrain.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ import (
2626
"slices"
2727
"strings"
2828
"sync"
29+
"syscall"
2930
"time"
3031

3132
"github.com/syncthing/syncthing/lib/build"
@@ -1562,6 +1563,12 @@ func (c *Client) generateSupportBundle(writer io.Writer, appInfo []byte) error {
15621563
infoJson["numGoroutines"] = runtime.NumGoroutine()
15631564
infoJson["numCPUs"] = runtime.NumCPU()
15641565

1566+
var rlimit syscall.Rlimit
1567+
if err := syscall.Getrlimit(syscall.RLIMIT_NOFILE, &rlimit); err == nil {
1568+
infoJson["currentFileDescriptorLimit"] = rlimit.Cur
1569+
infoJson["maxFileDescriptorLimit"] = rlimit.Max
1570+
}
1571+
15651572
var m runtime.MemStats
15661573
runtime.ReadMemStats(&m)
15671574
infoJson["allocatedHeapBytes"] = m.Alloc

0 commit comments

Comments
 (0)