Bz987 add truncation #2

1 commit merged into from Jan 31, 2011


None yet

2 participants


Reviewer: anyone.

See commit log for testing instructions.

@slfritchie slfritchie BZ 987: cluster_info formatting needs truncation limits
If the riak_err application is available (by asking the code server
about the riak_err_handler module), then user
riak_err_handler:limited_fmt/4 to provide message formatting and
truncation service.

In this new form, there's an implicit dependency on the riak_err
OTP application, but if that app isn't available, then the code
will simply not try to truncate messages.

To test:

Cut-and-paste these test commands in *two separate* groups.
Do not cut-and-paste as a single group.

Group 1:
  application:set_env(riak_err, term_max_size, 100).
  application:set_env(riak_err, fmt_max_bytes, 100).
  {ok, TestA} = file:read_file("/tmp/test-a.txt").
  {ok, TestB} = file:read_file("/tmp/test-b.txt").

Group 2:
  nomatch = re:run(TestA, "Oversize args for format").
  {match, _} = re:run(TestB, "Oversize args for format").

+1 checked it works.

It's probably better to couple riak_err with cluster_info than to duplicate the code.

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment