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

Do not send if payload size > max allowed. Fixes #879 #1230

Merged
merged 1 commit into from
Aug 17, 2015

Conversation

cpx86
Copy link
Contributor

@cpx86 cpx86 commented Aug 10, 2015

  • Added property MaximumPayloadBytes to Transport. For HeliosTransport
    this is the same as MaxFrameSize.
  • If payload size > MaximumPayloadBytes, log OversizedPayloadException
    and do not send message.

Corresponding Akka Scala code:
https://github.com/akka/akka/blob/master/akka-remote/src/main/scala/akka/remote/Endpoint.scala#L745
https://github.com/akka/akka/blob/master/akka-remote/src/test/scala/akka/remote/RemotingSpec.scala#L527
https://github.com/akka/akka/search?utf8=%E2%9C%93&q=maximumpayloadbytes

@rogeralsing
Copy link
Contributor

Looks solid

@cpx86
Copy link
Contributor Author

cpx86 commented Aug 10, 2015

All of those failed tests seem to pass on my machine. Build server instability, or did I miss something?

@Aaronontheweb
Copy link
Member

@cpx thanks for sending this in! Some of the tests are ones that are known to be racy, but your new test that you added has failed too. The smaller hardware we run the build server on is good at exposing race conditions that our powerful development laptops miss. Take a look at the error message and see if there's something going on with the code you added or the test you wrote, because if the test fails then it means it's sensitive to the latency from lower degrees of concurrency (crappy CPUs and less of them :p )

@cpx86
Copy link
Contributor Author

cpx86 commented Aug 10, 2015

@Aaronontheweb Well, it fails on the exception expectation; it received 2 OversizedPayloadException events instead of one. Seems strange to me since we're only sending one message and there's only one place where the error is logged. I"m a bit stumped; any tips on how that might happen?

@@ -51,10 +54,11 @@ private static string GetConfigString(Config conf, string name)
return value;
}

public TestTransport(Address localAddress, AssociationRegistry registry, string schemeIdentifier = "test")
public TestTransport(Address localAddress, AssociationRegistry registry, long maximumPayloadBytes = 32000, string schemeIdentifier = "test")
Copy link
Member

Choose a reason for hiding this comment

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

Does the Scala JVM transport support this constructor out of the box? Been a while since I've looked

Copy link
Member

Choose a reason for hiding this comment

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

@Aaronontheweb
Copy link
Member

@cpx do we have an equivalent of this https://github.com/akka/akka/blob/master/akka-remote/src/main/scala/akka/remote/Endpoint.scala#L934 on the EndpointReader in this PR? Could you add it?

Transport.MaximumPayloadBytes,
send.Message.GetType(),
pdu.Length));
_log.Error(reason, "Transient association error (association remains live)");
Copy link
Member

Choose a reason for hiding this comment

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

To get the spec to pass, you need to add return true; on a new line below here - this will signal the EndpointWriter not to queue up the oversized message for backoff + retry.

This is also equivalent to what the Scala code looks like: https://github.com/akka/akka/blob/master/akka-remote/src/main/scala/akka/remote/Endpoint.scala#L748

@cpx86
Copy link
Contributor Author

cpx86 commented Aug 13, 2015

@Aaronontheweb Ah, what a silly mistake from my side. Thank you for the help!
About the case in the receive function, I will check that ASAP. Definitely looks like we're missing that part.

@cpx86 cpx86 force-pushed the 879-log_frame_size_exceeding branch from fae1a77 to e17a66d Compare August 16, 2015 11:01
@Aaronontheweb
Copy link
Member

@cpx looks like my pre-build macro I added in Akka.MultiNodeTestRunner in my previous PR caused some problems this time. Please remove it if you don't mind :p

That's an interesting point.... I think it's intentional though but I'll have to double check.

Once you've fixed that build issue, could you squash all of these commits onto dev? Contributing.md outlines the steps for doing that if you need help.

@cpx86 cpx86 force-pushed the 879-log_frame_size_exceeding branch from e17a66d to 05f57b9 Compare August 17, 2015 09:10
@Aaronontheweb
Copy link
Member

Looks great - nicely done @cpx !

Aaronontheweb added a commit that referenced this pull request Aug 17, 2015
Do not send if payload size > max allowed. Fixes #879
@Aaronontheweb Aaronontheweb merged commit db903de into akkadotnet:dev Aug 17, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants