JPPF, java, parallel computing, distributed computing, grid computing, parallel, distributed, cluster, grid, cloud, open source, android, .net
JPPF

The open source
grid computing
solution

 Home   About   Features   Download   Documentation   On Github   Forums 
July 07, 2020, 10:47:02 AM *
Welcome,
Please login or register.

Login with username, password and session length
Advanced search  
News: New users, please read this message. Thank you!
  Home Help Search Login Register  
Pages: [1]   Go Down

Author Topic: Bug in JMXMPServer.java if ipv6 is used as management host  (Read 1040 times)

codemonkey

  • JPPF Council Member
  • *****
  • Posts: 138
Bug in JMXMPServer.java if ipv6 is used as management host
« on: April 21, 2016, 10:10:32 PM »

Hi Laurent, there's a bug in the JMXMPServer.java class in how the host/address is assigned to the the jmx url.

On start up of a node, the following error is reported when you have debug logging enabled:
Code: [Select]
Error creating the JMX server
ERROR [2016-04-21 13:34:20,380] Node1:StdOut: java.net.MalformedURLException: Address inside [...] must be numeric IPv6 address
ERROR [2016-04-21 13:34:20,380] Node1:StdOut: at javax.management.remote.JMXServiceURL.<init>(Unknown Source)
ERROR [2016-04-21 13:34:20,380] Node1:StdOut: at org.jppf.management.JMXMPServer.start(JMXMPServer.java:99)
ERROR [2016-04-21 13:34:20,380] Node1:StdOut: at org.jppf.server.node.JPPFNode.getJmxServer(JPPFNode.java:460)
ERROR [2016-04-21 13:34:20,381] Node1:StdOut: at org.jppf.server.node.JPPFNode.init(JPPFNode.java:287)
ERROR [2016-04-21 13:34:20,381] Node1:StdOut: at org.jppf.server.node.JPPFNode.run(JPPFNode.java:133)
ERROR [2016-04-21 13:34:20,381] Node1:StdOut: at org.jppf.node.NodeRunner.main(NodeRunner.java:136)

In the start method the logic is as such:
Code: [Select]
InetAddress addr = InetAddress.getByName(managementHost);
String host = (addr instanceof Inet6Address) ? "[" + managementHost + "]" : managementHost;
url = new JMXServiceURL("service:jmx:jmxmp://" + host + ':' + managementPort);

The second line above is the culprit. If the instanceof does return an ipv6 instance, the original value of managementHost is being assigned to the host var.

Code: [Select]
String host = (addr instanceof Inet6Address) ? "[" + addr.getAddress()+ "]" : managementHost;
url = new JMXServiceURL("service:jmx:jmxmp://" + host + ':' + managementPort);

My jppf-node.properties has the management host set to localhost, and the system's hosts file has the localhost entry as:
Code: [Select]
::1 localhost

Discovered in both version of JPPF 5.0.2 and 5.1.1

All the best,

CM
Logged

lolo

  • Administrator
  • JPPF Council Member
  • *****
  • Posts: 2261
    • JPPF Web site
Re: Bug in JMXMPServer.java if ipv6 is used as management host
« Reply #1 on: April 24, 2016, 11:14:47 AM »

Hi CM,

Thank you very mutch for this fine catch!
I have registered JPPF-448 JMXMPServer generates malformed JMX service urls for IPv6 addresses for this.
The bug is now fixed and I published the patch 01 for JPPF 5.1.3 which contains the fix.

Sincerely,
-Laurent
Logged

codemonkey

  • JPPF Council Member
  • *****
  • Posts: 138
Re: Bug in JMXMPServer.java if ipv6 is used as management host
« Reply #2 on: April 25, 2016, 05:00:25 PM »

Great thank you!
Logged

codemonkey

  • JPPF Council Member
  • *****
  • Posts: 138
Re: Bug in JMXMPServer.java if ipv6 is used as management host
« Reply #3 on: April 25, 2016, 07:17:18 PM »

Hi Laurent,
The fix has not been implemented in the 5.1.3 branch, I reviewed the code and it's the same as before. Also checked the code in the full source zip file

CM
Logged

lolo

  • Administrator
  • JPPF Council Member
  • *****
  • Posts: 2261
    • JPPF Web site
Re: Bug in JMXMPServer.java if ipv6 is used as management host
« Reply #4 on: April 25, 2016, 07:44:36 PM »

Hello CM,

I just checked and I can see the changes in the jppf-common-src.jar delivered in the patch.
If you take a look at the bug record for JPPF-448 you will see in the last comment, the branches in which the fix is implemented. For instance, for the branch 5.1, you can see it in revision 4021.

Also for information, we only have branches on major.minor versions, not on maintenance releases. We do have a tag for each maintenance releases as well, however bug fixes are only committed to branches.

I hope this clarifies,
-Laurent
« Last Edit: April 25, 2016, 08:02:46 PM by lolo »
Logged

codemonkey

  • JPPF Council Member
  • *****
  • Posts: 138
Re: Bug in JMXMPServer.java if ipv6 is used as management host
« Reply #5 on: April 25, 2016, 08:24:33 PM »

Hi Laurent thank you for the quick response.

I see the fix to the code in patch link you provided, however I had downloaded from browsing the source at https://sourceforge.net/projects/jppf-project/files/jppf-project/jppf%205.1.3/ thinking that the patch would also have been applied there.

So the question being is that I'm currently using JPPF 5.1.1. Does the 5.1.3 from the link above include fixes of 5.1.2? Or should I apply 5.1.2 and then apply the fix you just provided?

Thank you again,

CM


Logged

lolo

  • Administrator
  • JPPF Council Member
  • *****
  • Posts: 2261
    • JPPF Web site
Re: Bug in JMXMPServer.java if ipv6 is used as management host
« Reply #6 on: April 26, 2016, 07:10:47 AM »

Hi CM,

Sorry for not being clear on our delivery/publication process.

- Once a version is published and the distribution files are released to the SourceForge release system, these files are not touched anymore (unless I make a very big mistake in the release, which has happened in the past, but has not happened for a very long time).
- We try to publish regular maintenance releases, around once every 4-6 weeks
- In-between maintenance releases, we sometimes publish patches for immediate availability of one or more bug fixes
- A patch always applies to the latest maintenance release of a version, or to the initial version if there is no maintenance release yet. As an example, "patch 01 for JPPF 5.1.3" must be applied to an existing installation of v5.1.3. It may work if you install it on top of v5.1.1, but we cannot guarantee it and therefore we do not recommend it.
- there can be multiple patches for the same maintenance release, in which case they must all be applied to the affected version, in order of their numbering (e.g. first patch 01, then patch 02)

I hope this makes things clearer.

-Laurent
Logged

codemonkey

  • JPPF Council Member
  • *****
  • Posts: 138
Re: Bug in JMXMPServer.java if ipv6 is used as management host
« Reply #7 on: April 26, 2016, 05:39:16 PM »

Thank you very much for the clarification, much clearer thank you!

CM
Logged
Pages: [1]   Go Up
 
JPPF Powered by SMF 2.0 RC5 | SMF © 2006–2011, Simple Machines LLC Get JPPF at SourceForge.net. Fast, secure and Free Open Source software downloads