Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Large modpacks trigger a SIGABRT #45

Closed
mmtawous opened this issue May 5, 2024 · 4 comments
Closed

Large modpacks trigger a SIGABRT #45

mmtawous opened this issue May 5, 2024 · 4 comments

Comments

@mmtawous
Copy link
Contributor

mmtawous commented May 5, 2024

Currently, large modpacks such as the Versatile v7.5 pack triggers a SIGABRT caused by the following

runtime/cgo: pthread_create failed: Resource temporarily unavailable

This is caused by the value in the --dl-threads flag not being used in the Downloader. Here is a snippet of the relevant code from main.

type Downloader struct {
Downloads []*Download
Threads int // TODO
Retries int
}
func (g *Downloader) Download(baseDir string) {
var wg sync.WaitGroup
for i := range g.Downloads {
wg.Add(1)
dl := g.Downloads[i]
go func() {
defer wg.Done()
absPath, _ := filepath.Abs(filepath.Join(baseDir, dl.Path))
success := false
for _, link := range dl.Urls {
// retry when download failed
for retries := 0; retries < g.Retries; retries++ {
// try download

mmtawous added a commit to mmtawous/mrpack-install that referenced this issue May 5, 2024
@mmtawous mmtawous mentioned this issue May 5, 2024
nothub added a commit that referenced this issue May 5, 2024
@nothub
Copy link
Owner

nothub commented May 5, 2024

Resolved 🚀

@nothub nothub closed this as completed May 5, 2024
@nothub
Copy link
Owner

nothub commented May 5, 2024

On a sidenote, I tried to reproduce the issue once on my system but I was not able to reproduce it.
Can you post the DefaultTasksMax (systemctl show --property=DefaultTasksMax) on the system you experienced the issue on?

@mmtawous
Copy link
Contributor Author

mmtawous commented May 5, 2024

I am running on an Apple Silicon M2 Macbook Air running MacOS 13.5.1. MacOS doesn't have systemctl so here is what I think is the closest thing to what you are referring to. Oddly enough I don't think that modpack had 4096 things to download so maybe this isn't what I am looking for.

~  ulimit -u
2666

~  sysctl kern.num_threads
kern.num_threads: 20480

~  sysctl kern.num_taskthreads
kern.num_taskthreads: 4096

Adding print statements to the code before the fix doesn't give any more useful info. All 261 routines (there are 261 dependencies) appear to be started before it crashes. I am unfamiliar with how Go handles threads, so I can't offer any more insight into what's happening.

@nothub
Copy link
Owner

nothub commented May 5, 2024

Thanks for the infos, I gonna test around in a ressource constrained VM.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants