You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@qpid.apache.org by Adel Boutros <ad...@live.com> on 2016/04/14 19:57:13 UTC

[Qpid Dispatcher] Runtime behavior on SunOS

Hello,
We are trying to use qpid-dispatch on SunOS. Before I ask specific questions, I would like to know why in the readme, it is mentioned "Dispatch will not build on Windows"? Does it imply that the API was built for a pure Linux-oriented OS and thus it is expected to have issues on other OSes such as SunOS?
In our case, after some modifications, we were able to compile it on SunOS but the tests are failing.
Actually, we believe to have hit a problem which has to do with the multi-threading and locking mechanism in the dispatcher. We are unable to get the dispatcher ready to receive connections in the tests.
Regards,Adel Boutroswww.murex.com 		 	   		  

RE: [Qpid Dispatcher] Runtime behavior on SunOS

Posted by Adel Boutros <ad...@live.com>.
I also submitted in a different ticket fixes done on compilation level. https://issues.apache.org/jira/browse/DISPATCH-290
I have tested them on Linux and SunOS x86.
I have now started compiling qpid-dispatch on Windows and will post issues I encounter in a different thread.
Regards,
Adel

> From: adelboutros@live.com
> To: users@qpid.apache.org
> Subject: RE: [Qpid Dispatcher] Runtime behavior on SunOS
> Date: Thu, 21 Apr 2016 16:47:49 +0200
> 
> Done.https://issues.apache.org/jira/browse/DISPATCH-289
> 
> > Subject: Re: [Qpid Dispatcher] Runtime behavior on SunOS
> > To: users@qpid.apache.org
> > From: tross@redhat.com
> > Date: Thu, 21 Apr 2016 10:15:51 -0400
> > 
> > Can you attach these to a submitted issue in Jira?  (See: 
> > http://qpid.apache.org/issues.html#report-a-bug)
> > 
> > Due to licensing considerations, I don't think we can accept a patch via 
> > email.
> > 
> > Thanks,
> > 
> > -Ted
> > 
> > On 04/21/2016 09:59 AM, Adel Boutros wrote:
> > > Here are the patches for the master branch:
> > >
> > > 0001-Fix-issue-on-Solaris-related-to-access-modes-of-file.patch
> > > <http://qpid.2158936.n2.nabble.com/file/n7642448/0001-Fix-issue-on-Solaris-related-to-access-modes-of-file.patch>
> > > 0002-Use-connection-refused-constant-from-the-python-errn.patch
> > > <http://qpid.2158936.n2.nabble.com/file/n7642448/0002-Use-connection-refused-constant-from-the-python-errn.patch>
> > >
> > >
> > >
> > > --
> > > View this message in context: http://qpid.2158936.n2.nabble.com/Qpid-Dispatcher-Runtime-behavior-on-SunOS-tp7641941p7642448.html
> > > Sent from the Apache Qpid users mailing list archive at Nabble.com.
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: users-unsubscribe@qpid.apache.org
> > > For additional commands, e-mail: users-help@qpid.apache.org
> > >
> > 
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@qpid.apache.org
> > For additional commands, e-mail: users-help@qpid.apache.org
> > 
>  		 	   		  
 		 	   		  

RE: [Qpid Dispatcher] Runtime behavior on SunOS

Posted by Adel Boutros <ad...@live.com>.
Done.https://issues.apache.org/jira/browse/DISPATCH-289

> Subject: Re: [Qpid Dispatcher] Runtime behavior on SunOS
> To: users@qpid.apache.org
> From: tross@redhat.com
> Date: Thu, 21 Apr 2016 10:15:51 -0400
> 
> Can you attach these to a submitted issue in Jira?  (See: 
> http://qpid.apache.org/issues.html#report-a-bug)
> 
> Due to licensing considerations, I don't think we can accept a patch via 
> email.
> 
> Thanks,
> 
> -Ted
> 
> On 04/21/2016 09:59 AM, Adel Boutros wrote:
> > Here are the patches for the master branch:
> >
> > 0001-Fix-issue-on-Solaris-related-to-access-modes-of-file.patch
> > <http://qpid.2158936.n2.nabble.com/file/n7642448/0001-Fix-issue-on-Solaris-related-to-access-modes-of-file.patch>
> > 0002-Use-connection-refused-constant-from-the-python-errn.patch
> > <http://qpid.2158936.n2.nabble.com/file/n7642448/0002-Use-connection-refused-constant-from-the-python-errn.patch>
> >
> >
> >
> > --
> > View this message in context: http://qpid.2158936.n2.nabble.com/Qpid-Dispatcher-Runtime-behavior-on-SunOS-tp7641941p7642448.html
> > Sent from the Apache Qpid users mailing list archive at Nabble.com.
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@qpid.apache.org
> > For additional commands, e-mail: users-help@qpid.apache.org
> >
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@qpid.apache.org
> For additional commands, e-mail: users-help@qpid.apache.org
> 
 		 	   		  

Re: [Qpid Dispatcher] Runtime behavior on SunOS

Posted by Ted Ross <tr...@redhat.com>.
Can you attach these to a submitted issue in Jira?  (See: 
http://qpid.apache.org/issues.html#report-a-bug)

Due to licensing considerations, I don't think we can accept a patch via 
email.

Thanks,

-Ted

On 04/21/2016 09:59 AM, Adel Boutros wrote:
> Here are the patches for the master branch:
>
> 0001-Fix-issue-on-Solaris-related-to-access-modes-of-file.patch
> <http://qpid.2158936.n2.nabble.com/file/n7642448/0001-Fix-issue-on-Solaris-related-to-access-modes-of-file.patch>
> 0002-Use-connection-refused-constant-from-the-python-errn.patch
> <http://qpid.2158936.n2.nabble.com/file/n7642448/0002-Use-connection-refused-constant-from-the-python-errn.patch>
>
>
>
> --
> View this message in context: http://qpid.2158936.n2.nabble.com/Qpid-Dispatcher-Runtime-behavior-on-SunOS-tp7641941p7642448.html
> Sent from the Apache Qpid users mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@qpid.apache.org
> For additional commands, e-mail: users-help@qpid.apache.org
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@qpid.apache.org
For additional commands, e-mail: users-help@qpid.apache.org


Re: [Qpid Dispatcher] Runtime behavior on SunOS

Posted by Adel Boutros <ad...@live.com>.
Here are the patches for the master branch:

0001-Fix-issue-on-Solaris-related-to-access-modes-of-file.patch
<http://qpid.2158936.n2.nabble.com/file/n7642448/0001-Fix-issue-on-Solaris-related-to-access-modes-of-file.patch>  
0002-Use-connection-refused-constant-from-the-python-errn.patch
<http://qpid.2158936.n2.nabble.com/file/n7642448/0002-Use-connection-refused-constant-from-the-python-errn.patch>  



--
View this message in context: http://qpid.2158936.n2.nabble.com/Qpid-Dispatcher-Runtime-behavior-on-SunOS-tp7641941p7642448.html
Sent from the Apache Qpid users mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@qpid.apache.org
For additional commands, e-mail: users-help@qpid.apache.org


Re: [Qpid Dispatcher] Runtime behavior on SunOS

Posted by Ted Ross <tr...@redhat.com>.

On 04/21/2016 09:03 AM, Adel Boutros wrote:
> I finally managed to get all green tests on SunOS!
>
> Actually, there was another problem this time in the python script: In
> tests/system_test.py, when you check for available port, you compare the
> errno with the value 111 which is the value of "Connection refused" under
> Linux. But on Solaris, the value is 146 so all system tests hang forever as
> no available port is ever found.
>
> The fix is to use the constant from python (errno.ECONNREFUSED) instead of
> the magical number.
>
> Here is a patch explaining the fix ( connection-refused.patch
> <http://qpid.2158936.n2.nabble.com/file/n7642439/connection-refused.patch>
> )
>
> If you are happy with both patches, I would be happy to create a single
> patch on the master branch and submit it.

Please do.  We'll get these merged into the master.

-Ted

>
> Regards,
> Adel Boutros
> www.murex.com
>
>
>
> --
> View this message in context: http://qpid.2158936.n2.nabble.com/Qpid-Dispatcher-Runtime-behavior-on-SunOS-tp7641941p7642439.html
> Sent from the Apache Qpid users mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@qpid.apache.org
> For additional commands, e-mail: users-help@qpid.apache.org
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@qpid.apache.org
For additional commands, e-mail: users-help@qpid.apache.org


Re: [Qpid Dispatcher] Runtime behavior on SunOS

Posted by Adel Boutros <ad...@live.com>.
I finally managed to get all green tests on SunOS!

Actually, there was another problem this time in the python script: In
tests/system_test.py, when you check for available port, you compare the
errno with the value 111 which is the value of "Connection refused" under
Linux. But on Solaris, the value is 146 so all system tests hang forever as
no available port is ever found.

The fix is to use the constant from python (errno.ECONNREFUSED) instead of
the magical number.

Here is a patch explaining the fix ( connection-refused.patch
<http://qpid.2158936.n2.nabble.com/file/n7642439/connection-refused.patch> 
)

If you are happy with both patches, I would be happy to create a single
patch on the master branch and submit it.

Regards,
Adel Boutros
www.murex.com



--
View this message in context: http://qpid.2158936.n2.nabble.com/Qpid-Dispatcher-Runtime-behavior-on-SunOS-tp7641941p7642439.html
Sent from the Apache Qpid users mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@qpid.apache.org
For additional commands, e-mail: users-help@qpid.apache.org


Re: [Qpid Dispatcher] Runtime behavior on SunOS

Posted by Adel Boutros <ad...@live.com>.
I changed the way the test make sure the file descriptor is readable.
Actually, I try to read from it and check if the return code of read is that
of an error.

You can find attached the patch for qpid-dispatch 0.5  (solaris-pipe.patch)
<http://qpid.2158936.n2.nabble.com/file/n7642415/solaris-pipe.patch>  

What do you think?

Regards,
Adel Boutros
www.murex.com



--
View this message in context: http://qpid.2158936.n2.nabble.com/Qpid-Dispatcher-Runtime-behavior-on-SunOS-tp7641941p7642415.html
Sent from the Apache Qpid users mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@qpid.apache.org
For additional commands, e-mail: users-help@qpid.apache.org


Re: [Qpid Dispatcher] Runtime behavior on SunOS

Posted by Adel Boutros <ad...@live.com>.
After checking the help of pipe, the behavior is different between Solaris
and Linux.

On Linux, pipe returns 2 file descriptors: *one *for reading and *one *for
writing.
On Solaris, pipe returns 2 file descriptors: *both *are for reading and
writing.

So in the case of Solaris, the POLLOUT is valid as there is no data to read
but the file descriptor is ready to write.

Linux pipe ref: http://linux.die.net/man/2/pipe
Solaris pipe ref:
https://docs.oracle.com/cd/E53394_01/html/E54765/pipe-2.html

I think the test code which calls pipe should make the fd[0] read-only to
make the test work.

PS: The *revents *for the "write file descriptor" is actually POLLOUT on
both Solaris and Linux which makes sense with the explanation I just
provided.



--
View this message in context: http://qpid.2158936.n2.nabble.com/Qpid-Dispatcher-Runtime-behavior-on-SunOS-tp7641941p7642395.html
Sent from the Apache Qpid users mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@qpid.apache.org
For additional commands, e-mail: users-help@qpid.apache.org


Re: [Qpid Dispatcher] Runtime behavior on SunOS

Posted by ad...@live.com.

Thanks Andrew! We were also amazed at the fact it was a POLLOUT but it's not the first time Solaris has an inexplicable behavior ...


I will try to fix the code to ignore Pollout flag and let you know if it works.


Would it interest you if i provide a patch also in case it works?



Sent from Outlook Mobile



From: Andrew Stitcher

Sent: Wednesday, April 20, 19:31

Subject: Re: [Qpid Dispatcher] Runtime behavior on SunOS

To: users@qpid.apache.org



On Wed, 2016-04-20 at 08:03 -0700, Adel Boutros wrote:

> Here they are:

> 

> Solaris:

> 1)      qdpn_driver_wait_3:  idx=2, d->fds[idx].revents=*4*, POLLIN=1

> *Test dies here*


revents=4 seems to be POLLOUT.


Since this is the read end of a pipe (if I understood correctly) I'm

not sure why POLLOUT is true, or even why that bit is in the interest

set. But in any case it can just be ignored as dispatch is never going

to write to the read end of the pipe.


Andrew



---------------------------------------------------------------------

To unsubscribe, e-mail: users-unsubscribe@qpid.apache.org

For additional commands, e-mail: users-help@qpid.apache.org



Re: [Qpid Dispatcher] Runtime behavior on SunOS

Posted by Andrew Stitcher <as...@redhat.com>.
On Wed, 2016-04-20 at 08:03 -0700, Adel Boutros wrote:
> Here they are:
> 
> Solaris:
> 1)      qdpn_driver_wait_3:  idx=2, d->fds[idx].revents=*4*, POLLIN=1
> *Test dies here*

revents=4 seems to be POLLOUT.

Since this is the read end of a pipe (if I understood correctly) I'm
not sure why POLLOUT is true, or even why that bit is in the interest
set. But in any case it can just be ignored as dispatch is never going
to write to the read end of the pipe.

Andrew


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@qpid.apache.org
For additional commands, e-mail: users-help@qpid.apache.org


Re: [Qpid Dispatcher] Runtime behavior on SunOS

Posted by Adel Boutros <ad...@live.com>.
Here they are:

Solaris:
1)      qdpn_driver_wait_3:  idx=2, d->fds[idx].revents=*4*, POLLIN=1
*Test dies here*
 
Linux:
1)      qdpn_driver_wait_3:  idx=2, d->fds[idx].revents=*0*, POLLIN=1
2)      qdpn_driver_wait_3:  idx=2, d->fds[idx].revents=*1*, POLLIN=1
3)      … same as last one until end of test …



--
View this message in context: http://qpid.2158936.n2.nabble.com/Qpid-Dispatcher-Runtime-behavior-on-SunOS-tp7641941p7642368.html
Sent from the Apache Qpid users mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@qpid.apache.org
For additional commands, e-mail: users-help@qpid.apache.org


Re: [Qpid Dispatcher] Runtime behavior on SunOS

Posted by Andrew Stitcher <as...@redhat.com>.
On Tue, 2016-04-19 at 09:37 -0700, Adel Boutros wrote:
> ...
> Checking the man of poll, a positive value of revents indicated there
> are
> events to read on the pipe whereas a 0 value indicates nothing to
> read.

This is not exactly correct. revents is a set of flag bits:

If it is non zero then it tells you that something is interesting about
the fd the pollfd refers to.

This can be readable - POLLIN; writeable - POLLOUT; errored - POLLERR;
other end closed - POLLHUP; illegal fd - POLLNVAL. As these are flags
the actual value could be some combination of them too.

It might be useful to tell us what the actual flags value you are
seeing on revents actually is.

Andrew


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@qpid.apache.org
For additional commands, e-mail: users-help@qpid.apache.org


Re: [Qpid Dispatcher] Runtime behavior on SunOS

Posted by Adel Boutros <ad...@live.com>.
Hello Ted,

After reducing the number of threads to 1 and some debugging, we have found
the problem is actually related to *pipe *and *poll *calls on Solaris/Linux.

In the test, we define 2 file descriptors, one for read and one for write in
*tests/server_tests.c*
ufd_write = qd_user_fd(qd, fd[1], (void*) 1);
ufd_read  = qd_user_fd(qd, fd[0], (void*) 0);

When comparing between Linux and Solaris, in
*src/posix.driver.c:qdpn_driver_wait_2()* , we find that the first call to
poll will set the "revents" of the "fd[0]" to 0 on Linux and then it is
always non-zero. Whereas on Solaris it is always non-zero.

Do you have an idea why the "revents" is never "0" on Solaris?

When debugging in *qdpn_driver_wait_2*, *fd[0]* is actually represented by
d->fds[2]. So to see the revents, you can output the value of
*d->fds[2].revents*

Checking the man of poll, a positive value of revents indicated there are
events to read on the pipe whereas a 0 value indicates nothing to read.

PS: We are working on Qpid-dispatch 0.5.0

Regards,
Adel Boutros
www.murex.com



--
View this message in context: http://qpid.2158936.n2.nabble.com/Qpid-Dispatcher-Runtime-behavior-on-SunOS-tp7641941p7642306.html
Sent from the Apache Qpid users mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@qpid.apache.org
For additional commands, e-mail: users-help@qpid.apache.org


Re: [Qpid Dispatcher] Runtime behavior on SunOS

Posted by Ted Ross <tr...@redhat.com>.

On 04/14/2016 01:57 PM, Adel Boutros wrote:
> Hello,
> We are trying to use qpid-dispatch on SunOS. Before I ask specific questions, I would like to know why in the readme, it is mentioned "Dispatch will not build on Windows"? Does it imply that the API was built for a pure Linux-oriented OS and thus it is expected to have issues on other OSes such as SunOS?

Dispatch, like other Qpid projects, has an abstraction layer over the 
Operating System for locks, conditions, and threads.  It also has an IO 
driver that is OS-specific.  There's no reason why it can't run on 
Windows, SunOS, Solaris, or any other OS.  Nobody has as yet implemented 
the abstractions and IO driver for anything other than Linux.

> In our case, after some modifications, we were able to compile it on SunOS but the tests are failing.
> Actually, we believe to have hit a problem which has to do with the multi-threading and locking mechanism in the dispatcher. We are unable to get the dispatcher ready to receive connections in the tests.

Have you tried setting the workerThreads to 1 in the configuration? 
This might provide some insight into threading and locking issues.

-Ted

> Regards,Adel Boutroswww.murex.com 		 	   		
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@qpid.apache.org
For additional commands, e-mail: users-help@qpid.apache.org