Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

provider/template: fix race causing panic in template_file #4694

Merged
merged 1 commit into from
Jan 16, 2016

Commits on Jan 15, 2016

  1. provider/template: fix race causing panic in template_file

    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.
    phinze committed Jan 15, 2016
    Configuration menu
    Copy the full SHA
    0739cf2 View commit details
    Browse the repository at this point in the history