UnsupportedOperationException under Solaris

128 views
Skip to first unread message

Michael Salvagna

unread,
Nov 29, 2014, 5:41:09 PM11/29/14
to java-ch...@googlegroups.com
Hi folks,

Seeing an UnsupportedOperationException when attempting to use Chronicle-Queue on Solaris.  

java.lang.UnsupportedOperationException: null
        at net.openhft.affinity.impl.NullAffinity.getThreadId(NullAffinity.java:56) ~[affinity-2.1.2.jar:na]
        at net.openhft.affinity.AffinitySupport.getThreadId(AffinitySupport.java:118) ~[affinity-2.1.2.jar:na]
        at net.openhft.chronicle.VanillaChronicle$VanillaAppenderImpl.startExcerpt(VanillaChronicle.java:509) ~[chronicle-3.2.5.jar:na]
        at net.openhft.chronicle.VanillaChronicle$VanillaAppenderImpl.startExcerpt(VanillaChronicle.java:501) ~[chronicle-3.2.5.jar:na]

Does not seem Solaris is supported as Affinity support resolved to NullAffinity.  The closest I see for Affinity support for Solaris is PosixAffinity implementation.  

Is there something I can do to force to PosixAffinity?  Is Solaris even supported?

Version rundown:
chronicle-3.2.5
affinity-2.1.2
OS: SunOS MyServer 5.10 Generic_221341 i86pc i386 i86pc

Thanks!
Mike

Peter Lawrey

unread,
Nov 30, 2014, 1:06:07 AM11/30/14
to java-ch...@googlegroups.com

Solaris isn't supported however we could try to fix this. If you can get this method to work for affinity of solaris we can put that fix in.
Even though the call is notionally a posix call it works differently on windows and even ubuntu vs centos.

If you fork the affinity library and test this on solaris you should be able to get it to work as it is a simple method. It's just that we no way of testing this ourselves.

--
You received this message because you are subscribed to the Google Groups "Chronicle" group.
To unsubscribe from this group and stop receiving emails from it, send an email to java-chronicl...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Daniel Shaya

unread,
Nov 30, 2014, 6:00:07 AM11/30/14
to java-ch...@googlegroups.com
It might be worth trying the following to see if Solaris will work using our standard Posix solution.

There is a test on the property 'os.name' to see if it contains the letter 'x'.  If it does it will use the Posix implementation.
Just for the sake of testing can you set the Java property os.name to 'x' and try and run.

Then let us know how you get on.

In terms of trying to fix the code for a Solaris implementation you could start by looking at the code in:
net.openhft.affinity.impl.PosixJNAAffinity 

Rob Austin

unread,
Nov 30, 2014, 7:06:17 AM11/30/14
to java-ch...@googlegroups.com
Mike - if you are able to fix it on Solaris, it would be great if you could send us a pull request. - thanks. 

Michael Salvagna

unread,
Nov 30, 2014, 12:48:44 PM11/30/14
to java-ch...@googlegroups.com
OK, thanks for the Solaris support confirmation.  I agree it should be "easy" to fix :-)

I'll figure it out and pop a pull request.  

Cheers!
Mike

Rob Austin

unread,
Nov 30, 2014, 1:37:23 PM11/30/14
to java-ch...@googlegroups.com
Thanks

--

Michael Salvagna

unread,
Dec 1, 2014, 9:36:27 AM12/1/14
to java-ch...@googlegroups.com
Got it working on Solaris.  I only implemented the getThreadId() for now...  Left the affinity support for another time.  Pull Request should be coming your way.

This is my first pull request.  If I messed something up - which is highly probable, let me know.

Thanks,
Mike

Sanjay Prabhakar

unread,
Apr 23, 2015, 11:40:34 AM4/23/15
to java-ch...@googlegroups.com
I am also having simmilar issue while I use VanillaChronicle in Redhat linux release "2.6.18-238.5.1.el5 #1 SMP Mon Feb 21 05:52:39 EST 2011 x86_64 x86_64 x86_64 GNU/Linux"
 
Here is the exception...
 
Exception in thread "main" java.lang.UnsupportedOperationException
        at net.openhft.affinity.impl.NullAffinity.getThreadId(NullAffinity.java:57)
        at net.openhft.affinity.AffinitySupport.getThreadId(AffinitySupport.java:155)
        at net.openhft.chronicle.VanillaChronicle$VanillaAppenderImpl.startExcerpt(VanillaChronicle.java:546)
        at net.openhft.chronicle.VanillaChronicle$VanillaAppenderImpl.startExcerpt(VanillaChronicle.java:538)
        at Server.main(Server.java:37)

Peter Lawrey

unread,
Apr 23, 2015, 11:45:40 AM4/23/15
to java-ch...@googlegroups.com
We support redhat 6.x+ though the library should handle this error better.

--

Peter Lawrey

unread,
Apr 23, 2015, 11:54:30 AM4/23/15
to java-ch...@googlegroups.com
Actually this method has to work or VanillaChronicle won't work.  When the affinity library fails to call certain system calls, it falls back to the NullAffinity.
Reply all
Reply to author
Forward
0 new messages