-
Notifications
You must be signed in to change notification settings - Fork 647
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
Further MQTT streaming hardening #1327
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
I had thought that Behaviors.setup would only get called once for an actor. This is not the case - it is called each time a behaviour is transitioned to. There was only one place where my misunderstanding mattered, which was where a promise could be tried to be completed multiple times.
We observed an `InvalidActorNameException` when creating child actors. This could have been due to the following sequence when receiving a “Publish Received Locally” message: 1. prl received, producer actor created 2. producer actor terminates and sends a termination message 3. prl received before termination message is received, the parent actor creates another producer 4. the termination message is received and then attempts to create another producer with the same name The solution is to explicitly track active consumers and producers rather than rely on another data structure such as `context.children`, which will be updated in response to other events.
Duplicate publish events received from a remote were previously stashed until any existing handling was complete. This commit changes that so that they are routed and handled. The commit also tightens up some exception handling around benign exceptions that the developer should not need to consider.
This was referenced Nov 13, 2018
longshorej
reviewed
Nov 13, 2018
mqtt-streaming/src/main/scala/akka/stream/alpakka/mqtt/streaming/scaladsl/MqttSession.scala
Show resolved
Hide resolved
longshorej
reviewed
Nov 13, 2018
mqtt-streaming/src/main/scala/akka/stream/alpakka/mqtt/streaming/impl/ClientState.scala
Outdated
Show resolved
Hide resolved
mqtt-streaming/src/test/scala/docs/scaladsl/MqttSessionSpec.scala
Outdated
Show resolved
Hide resolved
In particular, actor names need to avoid the sequence number of an actor conflicting with MQTT topic names.
Packet ids were previously not distinguished according to their connection. This caused a problem when there was more than one client issuing the same packet ids! This commit addresses the problem by permitting the routing of remotely received packet ids by connection id and client id.
Accidentally removed topic filtering from a previous commit. This could cause unexpected behaviour given that every publish would be broadcast to all topics.
ennru
approved these changes
Nov 16, 2018
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.
LGTM.
Thank you! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Numerous hardening activities around MQTT streaming. Please visit each commit for a full description. However, in summary: