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

vertx.eventBus.send() always registers a reply handler #24

Closed
Narigo opened this issue Jul 24, 2013 · 4 comments
Closed

vertx.eventBus.send() always registers a reply handler #24

Narigo opened this issue Jul 24, 2013 · 4 comments
Assignees
Labels

Comments

@Narigo
Copy link
Member

Narigo commented Jul 24, 2013

IIRC this is a leak, if you don't send a reply back from the server side. It would register a handler but that would never be executed.

I guess the default value should just be null and it be disregarded by Vert.x in the Java core. Not sure whether this is the best approach, though. Probably better use an Option and then call the according Java API function.

@galderz
Copy link
Contributor

galderz commented Jul 26, 2013

Yeah, Option with a default value of None sounds good to me.

The Java API uses null as a way to figure out whether the reply handler needs to be registered or not. An Option would allow us to transform the optional reply handler from something that's Scala friendly to Java API.

On the Java side, EventBus.send() javadoc should be clearer on what values are allowed for replyHandler :|

@ghost ghost assigned galderz Jul 26, 2013
@ddossot
Copy link

ddossot commented Oct 3, 2013

While running load tests, throwing 500K string messages on the bus, I run into a memory leaks related to using vertx.eventBus.send() with vert.x 2.0.1-final and mod lang Scala 0.1.1-CR2. Note I was running in a 3 nodes cluster and the single message handler was registered locally in each node.

Basically, with either a no-op reply handler { ignoredReply => {} } or (null), I'm facing a memory leak while if I use vertx.internal.eventBus.send instead, no such leak shows up.

@Narigo
Copy link
Member Author

Narigo commented Oct 18, 2013

Can you test this again with #63 applied, please?

@Narigo
Copy link
Member Author

Narigo commented Nov 7, 2013

Please reopen / open a new issue if you still find leaks with registering (or unregistering) handlers.

@Narigo Narigo closed this as completed Nov 7, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants