diff options
author | Jean-Sébastien Pédron <jean-sebastien@rabbitmq.com> | 2020-02-07 19:27:38 +0100 |
---|---|---|
committer | Jean-Sébastien Pédron <jean-sebastien@rabbitmq.com> | 2020-02-07 19:30:59 +0100 |
commit | 52e6c65e004affb27489aab2d1bda2ca51aa7519 (patch) | |
tree | 4f9ad13e9f4a6ba3880bd3a41c8e0881eecf77fc /Makefile | |
parent | 44f5826b1bf609169d47162b0c444ad672b8edc9 (diff) | |
download | rabbitmq-server-git-52e6c65e004affb27489aab2d1bda2ca51aa7519.tar.gz |
Makefile: Improve Hex cache export
We hit the case where the exported Hex cache could not be read again
using `file:consult/2` when we try to restore the ETS table. The problem
was some string generated with `io_lib:format("~p")` which had invalid
Unicode characters according to `file:consult/1`.
The error returned by `file:consult/1` was:
{51,file_io_server,invalid_unicode}
We are now using `~w` instead of `~p` so string detection is skipped by
io_lib. The result is readable by `file:consult/1`, though the text file
is barely readable by a human now.
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -265,7 +265,7 @@ define dump_hex_cache_to_erl_term Key =:= write_concurrency orelse Key =:= compressed], Entries = ets:tab2list(Tab), - ok = file:write_file(Out, io_lib:format("~p.~n~p.~n", [Props, Entries])), + ok = file:write_file(Out, io_lib:format("~w.~n~w.~n", [Props, Entries])), ok = file:delete(In), init:stop(). endef |