basho / riak_core

Distributed systems infrastructure used by Riak.
Apache License 2.0
1.23k stars 392 forks source link

Fix size formatter crash on float value #955

Closed kpy3 closed 3 years ago

kpy3 commented 4 years ago

This prevents crash like

{'EXIT',
                                                  {badarg,
                                                   [{io_lib,format,
                                                     ["~B ~s",
                                                      [54.86940354760736,
                                                       "GB"]],
                                                     [{file,"io_lib.erl"},
                                                      {line,155}]},
                                                    {riak_core_format,fmt,2,
                                                     [{file,
                                                       "src/riak_core_format.erl"},
                                                      {line,37}]},
                                                    {riak_core_handoff_status,
                                                     row_details,2,
                                                     [{file,
                                                       "src/riak_core_handoff_status.erl"},
                                                      {line,104}]},
                                                    {riak_core_handoff_status,
                                                     '-build_handoff_details/1-lc$^0/1-0-',
                                                     2,
                                                     [{file,
                                                       "src/riak_core_handoff_status.erl"},
                                                      {line,87}]},

NOTE: This bug also exist in develop-3.0 branch

kpy3 commented 3 years ago

@martinsumner any chance to see this fix in upstream?

martinsumner commented 3 years ago

I'm expecting to cut a new release of 3.0 soon - so I've added this in with the other changes pending that release https://github.com/basho/riak_core/pull/965.

martinsumner commented 3 years ago

Not sure yet about when next to release from develop-2.9, but will merge this in in preparation for that