mirror of
https://github.com/opentofu/opentofu.git
synced 2025-02-14 09:34:03 -06:00
The render code path in `template_file` was doing unsynchronized access to a shared mapping of functions in `config.Func`. This caused a race condition that was most often triggered when a `template_file` had a `count` of more than one, and expressed itself as a panic in the plugin followed by a cascade of "unexpected EOF" errors through the plugin system. Here, we simply turn the FuncMap from shared state into a generated value, which avoids the race. We do more re-initialization of the data structure, but the performance implications are minimal, and we can always revisit with a perf pass later now that the race is fixed. |
||
---|---|---|
.. | ||
lang | ||
module | ||
test-fixtures | ||
append_test.go | ||
append.go | ||
config_string.go | ||
config_test.go | ||
config_tree.go | ||
config.go | ||
import_tree.go | ||
interpolate_funcs_test.go | ||
interpolate_funcs.go | ||
interpolate_test.go | ||
interpolate_walk_test.go | ||
interpolate_walk.go | ||
interpolate.go | ||
lang.go | ||
loader_hcl_test.go | ||
loader_hcl.go | ||
loader_test.go | ||
loader.go | ||
merge_test.go | ||
merge.go | ||
raw_config_test.go | ||
raw_config.go | ||
string_list_test.go | ||
string_list.go |