Project Home
Project Home
Documents
Documents
Wiki
Wiki
Discussion Forums
Discussions
Project Information
Project Info
Forum Topic - PSelect Getting Blocked For A Long Time : (11 Items)
   
PSelect Getting Blocked For A Long Time  
Facing one issue where PSELECT system call is getting blocked.. although data is being pushed continuously from one end 
, However PSELECT is not getting unblocked. After some time we see socket buffer gets completely filled and it starts 
throwing no buffer exception. 

As a recovery , we added timeout,  
We would like to know if there is any such known issue with PSELECT.
Re: PSELECT System Call Getting Blocked Forever  
Facing one issue where PSELECT system call is getting blocked.. although data is being pushed continuously from one end 
, However PSELECT is not getting unblocked. After some time we see socket buffer gets completely filled and it starts 
throwing no buffer exception. 

As a recovery , we added timeout,  
We would like to know if there is any such known issue with PSELECT.
Re: PSelect Getting Blocked For A Long Time  
Hi,

side note: one message would have been quite enough :-)

> Facing one issue where PSELECT system call is getting blocked.. although data 
> is being pushed continuously from one end , However PSELECT is not getting 
> unblocked. After some time we see socket buffer gets completely filled and it 
> starts throwing no buffer exception. 
> 
> As a recovery , we added timeout,  
> We would like to know if there is any such known issue with PSELECT.

I'd suggest you try to create a minimal reproduction case that clearly demonstrates the behaviour you're describing. 
Also make sure to add information about version of QNX and the platform you're using.

HTH
Michael
Re: PSelect Getting Blocked For A Long Time  
we have a use case where multiple clients are writing data to same socket which is receiver end.
 
Socket type used is SOCK_DGRAM
Operating System: QNX 7 
Platform: Qualcomm 6145 
setsockopt BUFFER_SIZE: 246000
 
We encountered no buffer exception in our code. Below is the syntax for pselect system call.. and we are using send/recv
 apis to send and received the data.

pselect((maxFd + 1), &mFdSet, NULL, NULL, NULL, NULL)
 
send(mFd,buffer,uiSize, MSG_WAITALL);
recv(fd, buffer,uiSize,MSG_WAITALL);
 
when multiple clients were trying to write the data, send api was returning "no buffer" exception.
 
when we checked in detail and added log before and after pselect system call, we observed that initially when we were 
pushing data before and after pselect prints were coming 

and then suddenly "after pselect" print stopped coming although data was being pushed from client side, after some time 
when socket buffer becomes full, clinets started getting "no buffer".
Re: PSelect Getting Blocked For A Long Time  
Hi Michael Schuster , 

I have provided the details. Is this sufficient for you to narrow down the issue. 
Please let us know . 

Thanks 
Sayooj Mandodi

Re: PSelect Getting Blocked For A Long Time  
> 
> Hi Michael Schuster , 
> 
> I have provided the details. Is this sufficient for you to narrow down the 
> issue. 

no, you provided code snippets. 

Code that compiles and runs and demonstrates what you claim to see is something different. 

In addition to actual runnable code, show how to run it to reproduce the behaviour.

regards

> Please let us know . 
> 
> Thanks 
> Sayooj Mandodi
> 


Re: PSelect Getting Blocked For A Long Time  
What is the highest fd in this case? Note that select() uses a fixed value for the fd set, and is generally considered 
as a bad interface as a result. If the highest fd is greater than 255 then you need to re-define FD_SETSIZE. Better yet,
 switch to poll().

--Elad
Re: PSelect Getting Blocked For A Long Time  
We have verified that during issue scenario correct FD is being passed to pselect.
Same doubt was raised and when pselect was getting blocked we printed the FD and made sure its valid one . 
Re: PSelect Getting Blocked For A Long Time  
That's not what I asked. What is the numerical value of the fd? select() has an upper limit of 255.
Re: PSelect Getting Blocked For A Long Time  
we had printed FD value... in case of issue,  FD was less than 255.
Re: PSelect Getting Blocked For A Long Time  
> we had printed FD value... in case of issue,  FD was less than 255.
I mean,  FD was coming random value , which was always less than 255 .