Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
remove recursion from moduleInfo.load()
moduleInfo.load() used to load modules and depdencies recursively, and due to some unfortunate circumstances it would usually create a very deep call stack where each load() called another load() to load the next one. The terraform parsing uses enough stack space that this can become a problem, so for a slightly big project this sometimes caused atlantis to die from a stack overflow: runtime: goroutine stack exceeds 1000000000-byte limit runtime: sp=0xc021478380 stack=[0xc021478000, 0xc041478000] fatal error: stack overflow [...] github.com/runatlantis/atlantis/server/events.moduleInfo.load(...) ...atlantis/server/events/modules.go:108 +0x46b fp=0xc021478750 sp=0xc021478570 pc=0xfeaa6b github.com/runatlantis/atlantis/server/events.moduleInfo.load(...) ...atlantis/server/events/modules.go:108 +0x46b fp=0xc021478930 sp=0xc021478750 pc=0xfeaa6b github.com/runatlantis/atlantis/server/events.moduleInfo.load(...) ...atlantis/server/events/modules.go:108 +0x46b fp=0xc021478b10 sp=0xc021478930 pc=0xfeaa6b ... and so on, several hundred times.
- Loading branch information