-
Notifications
You must be signed in to change notification settings - Fork 97
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
Validate command reply modes #320
Conversation
{call, From} -> | ||
{keep_state, State0, [{reply, From, Error}]}; | ||
_ -> | ||
{keep_state, State0, []} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For pipeline commands, the command is silently discarded here if the reply mode is unrecognized. Should we log a message or exit so it's more noticeable?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that is ok as pipelining always have to account for commands going missing and ensure resends when detected
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On second thought we could add a counter for these. That would make them detectable at least
`ra_server:command_reply_mode()` was not previously validated on the `ra_server`-side. If a command were sent with an unknown reply mode, the Ra server would never reply or notify the caller. Sending an unknown reply mode might happen when a client sends a new command to a Ra server which is operating on an old version of Ra. This change validates reply modes within the `ra_server`, replying with an error tuple when an invalid reply mode is passed.
3f1d74d
to
be203b9
Compare
Proposed Changes
Command reply modes (
ra_server:command_reply_mode()
) were not previously validated. If an old Ra system were sent a reply mode introduced in some new change, the Ra system would never reply or notify the caller. With this change, the caller receives an error tuple reply for the unknown mode.This is necessary to mitigate the effects of adding new reply modes as in #314 in cases where senders of commands may be running newer Ra versions than a running Ra system.
Types of Changes
What types of changes does your code introduce to this project?
Put an
x
in the boxes that applyChecklist
Put an
x
in the boxes that apply. You can also fill these out after creatingthe 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.
CONTRIBUTING.md
document