Skip to content

handle timeout error on sum_bucket/2#759

Merged
kuenishi merged 3 commits into
release/1.4from
bugfix/ku-cs-743-timeout
Dec 28, 2013
Merged

handle timeout error on sum_bucket/2#759
kuenishi merged 3 commits into
release/1.4from
bugfix/ku-cs-743-timeout

Conversation

@kuenishi
Copy link
Copy Markdown
Contributor

addresses #743.
from commit message:

add error handling when sum_bucket failed with timeout, which
causes dirty error message and no way to know which bucket was
failed in usage calculation mapreduce. This commit adds two ways
to know that:

- outputs an error log that prints user key id and bucket name
  with error reason.
- stores the result into moss.storage with reason like:
    { "bucket_name" : "{error,{timeout,[]}}" }

The latter log proves and indicated there existed a bucket at
that time even though its usage size was unknown. Better than
ignored, which operator can't tell non-existent from calculation
failure.

causes dirty error message and no way to know which bucket was
failed in usage calculation mapreduce. This commit adds two ways
to know that:

- outputs an error log that prints user key id and bucket name
  with error reason.
- stores the result into moss.storage with reason like:
    { "bucket_name" : "{error,{timeout,[]}}" }

The latter log proves and indicated there existed a bucket at
that time even though its usage size was unknown. Better than
ignored, which operator can't tell non-existent from calculation
failure.
@andrewjstone
Copy link
Copy Markdown
Contributor

Code looks good.

  • cs743_regression_test riak_test
  • eunit + eqc
  • dialyzer
  • xref

@andrewjstone
Copy link
Copy Markdown
Contributor

I'm seeing the following dialyzer errors related to this change:

riak_cs_storage.erl:60: Invalid type specification for function riak_cs_storage:maybe_sum_bucket/3. The success typing is (pid(),[binary() | maybe_improper_list(any(),binary() | []) | byte()],binary() | [byte()]) -> {binary() | [byte()],binary()}
riak_cs_storage.erl:64: The pattern {'ok', BucketUsage} can never match the type {'error',_} | {'struct',[{_,_},...]}

@kuenishi
Copy link
Copy Markdown
Contributor Author

Hooray! It was totally a bug found by dialyzer.
This regression could be found if #703 were done.

@ghost ghost assigned kuenishi Dec 27, 2013
@andrewjstone
Copy link
Copy Markdown
Contributor

👍

kuenishi added a commit that referenced this pull request Dec 28, 2013
handle timeout error on sum_bucket/2
@kuenishi kuenishi merged commit 34d8321 into release/1.4 Dec 28, 2013
@kuenishi kuenishi deleted the bugfix/ku-cs-743-timeout branch December 28, 2013 11:50
Comment thread src/riak_cs_storage.erl
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s/unless/without

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh crap. Thank you for pointing it out.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants