Re: Review Request 46296: SAMZA-932: JMX port collisions in JmxServer

2016-04-18 Thread Jake Maes

---
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/46296/#review129363
---




samza-core/src/main/scala/org/apache/samza/metrics/JmxServer.scala (line 80)


I think this will have a similar chance of port collision. 

Initially, I was thinking the best way is to create another ServerSocket 
using the ssFactory and get the local port the same way we did for 
registryPort. That may work if the port is unspecified (0), but it would cause 
a collision with the registry port if a specific port is specified. We could 
handle the ports differently depending on whether the port is specified or not, 
but the code would be messy.

After some research, it looks like we might be able to omit the serverPort 
altogether and simplify the JMXServiceURL to
"service:jmx:rmi:///jndi/rmi://localhost:" + registryPort + "/jmxrmi"

http://stackoverflow.com/questions/2768087/explain-jmx-url

This needs to be tested, though.


- Jake Maes


On April 16, 2016, 4:20 a.m., Tao Feng wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/46296/
> ---
> 
> (Updated April 16, 2016, 4:20 a.m.)
> 
> 
> Review request for samza.
> 
> 
> Repository: samza
> 
> 
> Description
> ---
> 
> SAMZA-932: JMX port collisions in JmxServer
> 
> 
> Diffs
> -
> 
>   samza-core/src/main/scala/org/apache/samza/metrics/JmxServer.scala 
> e6204c10878589d34096378e6000709266a9b4a5 
> 
> Diff: https://reviews.apache.org/r/46296/diff/
> 
> 
> Testing
> ---
> 
> ./gradlew clean build && ./gradlew checkstyleMain checkstyleTest
> 
> 
> Thanks,
> 
> Tao Feng
> 
>



Review Request 46296: SAMZA-932: JMX port collisions in JmxServer

2016-04-15 Thread Tao Feng

---
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/46296/
---

Review request for samza.


Repository: samza


Description
---

SAMZA-932: JMX port collisions in JmxServer


Diffs
-

  samza-core/src/main/scala/org/apache/samza/metrics/JmxServer.scala 
e6204c10878589d34096378e6000709266a9b4a5 

Diff: https://reviews.apache.org/r/46296/diff/


Testing
---

./gradlew clean build && ./gradlew checkstyleMain checkstyleTest


Thanks,

Tao Feng