Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tiny shovel-related fixes #5892

Merged
merged 4 commits into from
Oct 8, 2022
Merged

Conversation

gomoripeti
Copy link
Contributor

Proposed Changes

  • Remove unused fields from shovel_worker state record

    These fields were moved to the config map with the introduction of protocol callbacks.

  • Fix table layout for terminated shovel status

    I believe this is rarely visible as the shovel is quickly restarted or removed after termination.

  • Fix error handling of shovel_management delete/restart shovel

    An rpc:call can return {badrcp, Reason} with an arbitrary Reason term,
    so it cannot be passed to rabbit_log:error/1 which expects an atom,
    string or binary as its argument.

    This fixes the below crash

 exception error: no function clause matching
                  logger:do_log_allowed(error,
                                        {{'EXIT',
                                          {{badmatch,
...
   in function  rabbit_shovel_mgmt:delete_resource/2 (rabbit_shovel_mgmt.erl, line 92)

Types of Changes

What types of changes does your code introduce to this project?
Put an x in the boxes that apply

  • Bug fix (non-breaking change which fixes issue #NNNN)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause an observable behavior change in existing systems)
  • Documentation improvements (corrections, new content, etc)
  • Cosmetic change (whitespace, formatting, etc)
  • Build system and/or CI

Checklist

Put an x in the boxes that apply.
You can also fill these out after creating the PR.
If you're unsure about any of them, don't hesitate to ask on the mailing list.
We're here to help!
This is simply a reminder of what we are going to look for before merging your code.

Further Comments

If this is a relatively large or complex change, kick off the discussion by explaining why you chose the solution you did and what alternatives you considered, etc.

@michaelklishin
Copy link
Member

There is a repeatable failure in the Shovel management plugin suite.

@michaelklishin
Copy link
Member

Here is the exception from Common Test:

=== Ended at 2022-09-28 15:09:12
=== Location: [{rabbit_shovel_mgmt,delete_resource,82},
              {rabbit_shovel_mgmt_SUITE,delete_resource_badrpc,[87](file:///private/var/tmp/_bazel_antares/14f90f8a31f5e7ccfc4ded95d3ba96d8/execroot/__main__/bazel-out/darwin-fastbuild/testlogs/deps/rabbitmq_shovel_management/rabbit_shovel_mgmt_SUITE/test.outputs/outputs/ct_run.ct-rabbitmq_shovel_management-rabbit_shovel_mgmt_SUITE@klishinm-a02.2022-09-28_15.09.11/deps.rabbitmq_shovel_management.rabbit_shovel_mgmt_SUITE.logs/run.2022-09-28_15.09.11/rabbit_shovel_mgmt_suite.src.html#87)},
              {test_server,ts_tc,1782},
              {test_server,run_test_case_eval1,1291},
              {test_server,run_test_case_eval,1223}]
=== === Reason: no case clause matching {error,
                                          {corrupt_or_missing_cluster_files,
                                           {error,enoent},
                                           {error,enoent}}}
  in function  rabbit_shovel_mgmt:delete_resource/2 (rabbit_shovel_mgmt.erl, line 82)
  in call from rabbit_shovel_mgmt_SUITE:delete_resource_badrpc/1 (rabbit_shovel_mgmt_SUITE.erl, line 87)
  in call from test_server:ts_tc/3 (test_server.erl, line 1782)

@gomoripeti
Copy link
Contributor Author

it's the very testcase that I added, that fails, a bit embarrassing. will find the time to fix next week

These fields were moved to the config map with the introduction of
protocol callbacks.
I believe this is rarely visible as the shovel is quickly restarted or
removed after termination.
An rpc:call can return `{badrcp, Reason}` with an arbitrary Reason term,
so it cannot be passed to rabbit_log:error/1 which expects an atom,
string or binary as its argument.

This fixes the below crash

```
 exception error: no function clause matching
                  logger:do_log_allowed(error,
                                        {{'EXIT',
                                          {{badmatch,
...
   in function  rabbit_shovel_mgmt:delete_resource/2 (rabbit_shovel_mgmt.erl, line 92)
```
@michaelklishin michaelklishin merged commit 7d1085e into rabbitmq:main Oct 8, 2022
@michaelklishin michaelklishin added this to the 3.11.1 milestone Oct 8, 2022
michaelklishin added a commit that referenced this pull request Oct 8, 2022
michaelklishin added a commit that referenced this pull request Oct 8, 2022
Tiny shovel-related fixes (backport #5892) (backport #6061)
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.

2 participants