Skip to content

jvm_options may not be overridable because of sort in template #1053

Open
@ThomasLohner

Description

@ThomasLohner
  • Module version: 6.4.0 / master
  • Puppet version: all
  • OS and version: all

Bug description

Trying to set the jvm_option -Xms1024m does not work. The resulting jvm.options-File will look like this:

...
-Xms1024m
-Xms2048m
-Xmx1024m
-Xmx2048m
...

This is because of a default -Xms2048m which is set in jvm.options.erb and @jvm_options.sort.each in the same template. Sorting all keys of the jvm_options-Array results in -Xms2048m being written to the File after -Xms1024m. So effectively the default will override what is defined in jvm_options-Array.

How to reproduce

elasticsearch::jvm_options:
  - '-Xms1024m'
  - '-Xmx1024m'

Quickfix

Not nice but effective: Skipping sort will still write both options to jvm.options-File but java will only consider the last occurrence of the same key.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions