Quantcast

ThreadedSocketInitiator/Acceptor + Application - occasional socket errors

classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

ThreadedSocketInitiator/Acceptor + Application - occasional socket errors

lucious
QuickFIX Documentation: http://www.quickfixengine.org/quickfix/doc/html/index.html
QuickFIX Support: http://www.quickfixengine.org/services.html


Hi all,

We're trying to move from SocketInitiator/Accept + Application to ThreadedSocketXXX + Application. However with ThreadedSockets we can observer on every single session random socket errors then logon. It doesn't occure in the same time in all session - it's rather random. I'm running this on Ubuntu 12.04 64bit with qf c++ 1.13.3. Can anyone suggest what can be wrong?

Thx
M.

------------------------------------------------------------------------------
Own the Future-Intel® Level Up Game Demo Contest 2013
Rise to greatness in Intel's independent game demo contest.
Compete for recognition, cash, and the chance to get your game
on Steam. $5K grand prize plus 10 genre and skill prizes.
Submit your demo by 6/6/13. http://p.sf.net/sfu/intel_levelupd2d
_______________________________________________
Quickfix-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quickfix-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: ThreadedSocketInitiator/Acceptor + Application - occasional socket errors

Grant Birchmeier
QuickFIX Documentation: http://www.quickfixengine.org/quickfix/doc/html/index.html
QuickFIX Support: http://www.quickfixengine.org/services.html

I think you'll need to provide more information on your socket errors
before anyone can help.


On Mon, Mar 25, 2013 at 4:47 PM, Marcin Giedz <[hidden email]> wrote:

> QuickFIX Documentation: http://www.quickfixengine.org/quickfix/doc/html/index.html
> QuickFIX Support: http://www.quickfixengine.org/services.html
>
>
> Hi all,
>
> We're trying to move from SocketInitiator/Accept + Application to ThreadedSocketXXX + Application. However with ThreadedSockets we can observer on every single session random socket errors then logon. It doesn't occure in the same time in all session - it's rather random. I'm running this on Ubuntu 12.04 64bit with qf c++ 1.13.3. Can anyone suggest what can be wrong?
>
> Thx
> M.
>
> ------------------------------------------------------------------------------
> Own the Future-Intel&reg; Level Up Game Demo Contest 2013
> Rise to greatness in Intel's independent game demo contest.
> Compete for recognition, cash, and the chance to get your game
> on Steam. $5K grand prize plus 10 genre and skill prizes.
> Submit your demo by 6/6/13. http://p.sf.net/sfu/intel_levelupd2d
> _______________________________________________
> Quickfix-users mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/quickfix-users
>



--
Grant Birchmeier
Connamara Systems, LLC
Made-To-Measure Trading Solutions.
Exactly what you need. No more. No less.
http://connamara.com

------------------------------------------------------------------------------
Own the Future-Intel&reg; Level Up Game Demo Contest 2013
Rise to greatness in Intel's independent game demo contest.
Compete for recognition, cash, and the chance to get your game
on Steam. $5K grand prize plus 10 genre and skill prizes.
Submit your demo by 6/6/13. http://p.sf.net/sfu/intel_levelupd2d
_______________________________________________
Quickfix-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quickfix-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: ThreadedSocketInitiator/Acceptor + Application - occasional socket errors

Mike Gatny
In reply to this post by lucious
QuickFIX Documentation: http://www.quickfixengine.org/quickfix/doc/html/index.html
QuickFIX Support: http://www.quickfixengine.org/services.html


Post your cfg file, Quickfix events log, and Quickfix messages log, please.


------------------------------------------------------------------------------
Own the Future-Intel&reg; Level Up Game Demo Contest 2013
Rise to greatness in Intel's independent game demo contest.
Compete for recognition, cash, and the chance to get your game
on Steam. $5K grand prize plus 10 genre and skill prizes.
Submit your demo by 6/6/13. http://p.sf.net/sfu/intel_levelupd2d
_______________________________________________
Quickfix-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quickfix-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: ThreadedSocketInitiator/Acceptor + Application - occasional socket errors

lucious
In reply to this post by Grant Birchmeier
QuickFIX Documentation: http://www.quickfixengine.org/quickfix/doc/html/index.html
QuickFIX Support: http://www.quickfixengine.org/services.html


Hi,

event log:
20130326-12:45:52.075 : Created session
20130326-12:45:52.080 : Connecting to 192.168.89.61 on port 5593
20130326-12:45:52.085 : Initiated logon request
20130326-12:45:52.208 : Received logon response
20130326-12:47:03.227 : Socket Error: Interrupted system call
20130326-12:47:03.227 : Disconnecting
20130326-12:47:22.095 : Connecting to 192.168.89.61 on port 5593
20130326-12:47:22.097 : Initiated logon request
20130326-12:47:22.215 : Received logon response

messages.log
20130326-12:45:52.085 : 8=FIX.4.4.9=76.35=A.34=374.49=IPO05_CB.52=20130326-12:45:52.085.56=CEESEG_SIMU.98=0.108=30.10=235.
20130326-12:45:52.200 : 8=FIX.4.4.9=88.35=A.56=IPO05_CB.49=CEESEG_SIMU.52=20130326-12:45:52.180.34=374.58=12.12.04.108=30.98=0.10=027.
20130326-12:46:22.205 : 8=FIX.4.4.9=64.35=0.56=IPO05_CB.49=CEESEG_SIMU.52=20130326-12:46:22.184.34=375.10=189.
20130326-12:46:22.205 : 8=FIX.4.4.9=64.35=0.34=375.49=IPO05_CB.52=20130326-12:46:22.205.56=CEESEG_SIMU.10=183.
20130326-12:46:52.213 : 8=FIX.4.4.9=64.35=0.56=IPO05_CB.49=CEESEG_SIMU.52=20130326-12:46:52.193.34=376.10=193.
20130326-12:46:52.214 : 8=FIX.4.4.9=64.35=0.34=376.49=IPO05_CB.52=20130326-12:46:52.213.56=CEESEG_SIMU.10=186.
20130326-12:47:22.096 : 8=FIX.4.4.9=76.35=A.34=377.49=IPO05_CB.52=20130326-12:47:22.096.56=CEESEG_SIMU.98=0.108=30.10=239.
20130326-12:47:22.214 : 8=FIX.4.4.9=88.35=A.56=IPO05_CB.49=CEESEG_SIMU.52=20130326-12:47:22.194.34=377.58=12.12.04.108=30.98=0.10=034.
20130326-12:47:52.225 : 8=FIX.4.4.9=64.35=0.56=IPO05_CB.49=CEESEG_SIMU.52=20130326-12:47:52.203.34=378.10=188.
20130326-12:47:52.226 : 8=FIX.4.4.9=64.35=0.34=378.49=IPO05_CB.52=20130326-12:47:52.225.56=CEESEG_SIMU.10=192.
20130326-12:48:22.233 : 8=FIX.4.4.9=64.35=0.56=IPO05_CB.49=CEESEG_SIMU.52=20130326-12:48:22.212.34=379.10=187.

session conf:
[SESSION]
BeginString=FIX.4.4
ConnectionType=initiator
SenderCompID=IPO05_CB
TargetCompID=CEESEG_SIMU
SessionIdQualifier=SESXT1
StartTime=05:30:00
Endtime=21:30:00
StartDay=monday
EndDay=sunday
ResetOnLogout=N
RefreshOnLogon=Y
PersistMessages=N
HeartBtInt=30
Datadictionary=/opt/quickfix-1.13.3/share/quickfix/FIX44CEESEG.xml
SocketConnectHost=192.168.89.61
SocketConnectPort=5593

part of the code:
        if ( lSettingsAcceptor.getSessions().size() > 0 ) {
                qDebug()<<Q_FUNC_INFO<< "Create Acceptors" << lSettingsAcceptor.getSessions().size();
                m_socketAcceptor = new FIX::ThreadedSocketAcceptor( m_fixHubApplication, *lStoreFactory, lSettingsAcceptor, *lLogFactory );
                m_socketAcceptor->start();
                qDebug()<<Q_FUNC_INFO<<"starting Acceptor";
        }

        if ( lSettingsInitiator.getSessions().size() > 0 ) {
                qDebug()<<Q_FUNC_INFO<< "Create Initiator" << lSettingsInitiator.getSessions().size();
                m_socketInitiator = new FIX::ThreadedSocketInitiator( m_fixHubApplication, *lStoreFactory, lSettingsInitiator, *lLogFactory );
                m_socketInitiator->start();
                qDebug()<<Q_FUNC_INFO<<"starting Initiator";
        }

This problem only occure on ThreadedSocketxxx ... what should I check/do next?

Thx
M.


Od: "Grant Birchmeier" <[hidden email]>
Do: "Marcin Giedz" <[hidden email]>
DW: [hidden email]
Wysłane: wtorek, 26 marzec 2013 0:40:14
Temat: Re: [Quickfix-users] ThreadedSocketInitiator/Acceptor + Application - occasional socket errors

I think you'll need to provide more information on your socket errors
before anyone can help.


On Mon, Mar 25, 2013 at 4:47 PM, Marcin Giedz <[hidden email]> wrote:

> QuickFIX Documentation: http://www.quickfixengine.org/quickfix/doc/html/index.html
> QuickFIX Support: http://www.quickfixengine.org/services.html
>
>
> Hi all,
>
> We're trying to move from SocketInitiator/Accept + Application to ThreadedSocketXXX + Application. However with ThreadedSockets we can observer on every single session random socket errors then logon. It doesn't occure in the same time in all session - it's rather random. I'm running this on Ubuntu 12.04 64bit with qf c++ 1.13.3. Can anyone suggest what can be wrong?
>
> Thx
> M.
>
> ------------------------------------------------------------------------------
> Own the Future-Intel&reg; Level Up Game Demo Contest 2013
> Rise to greatness in Intel's independent game demo contest.
> Compete for recognition, cash, and the chance to get your game
> on Steam. $5K grand prize plus 10 genre and skill prizes.
> Submit your demo by 6/6/13. http://p.sf.net/sfu/intel_levelupd2d
> _______________________________________________
> Quickfix-users mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/quickfix-users
>



--
Grant Birchmeier
Connamara Systems, LLC
Made-To-Measure Trading Solutions.
Exactly what you need. No more. No less.
http://connamara.com


------------------------------------------------------------------------------
Own the Future-Intel&reg; Level Up Game Demo Contest 2013
Rise to greatness in Intel's independent game demo contest.
Compete for recognition, cash, and the chance to get your game
on Steam. $5K grand prize plus 10 genre and skill prizes.
Submit your demo by 6/6/13. http://p.sf.net/sfu/intel_levelupd2d
_______________________________________________
Quickfix-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quickfix-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: ThreadedSocketInitiator/Acceptor + Application - occasional socket errors

Mike Gatny
QuickFIX Documentation: http://www.quickfixengine.org/quickfix/doc/html/index.html
QuickFIX Support: http://www.quickfixengine.org/services.html


Looks like socket recv/send is returning EINTR, meaning that the thread received a signal during the syscall.  Are you intentionally using posix signals in your program?  If so, are you taking steps in your main program to block all signals, then explicitly handle them on one thread?  Or are you perhaps unintentionally using signals, e.g. by using sleep(3) (from unistd.h) instead of nanosleep?

--
Mike Gatny
Connamara Systems, LLC

------------------------------------------------------------------------------
Own the Future-Intel&reg; Level Up Game Demo Contest 2013
Rise to greatness in Intel's independent game demo contest.
Compete for recognition, cash, and the chance to get your game
on Steam. $5K grand prize plus 10 genre and skill prizes.
Submit your demo by 6/6/13. http://p.sf.net/sfu/intel_levelupd2d
_______________________________________________
Quickfix-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quickfix-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: ThreadedSocketInitiator/Acceptor + Application - occasional socket errors

lucious
QuickFIX Documentation: http://www.quickfixengine.org/quickfix/doc/html/index.html
QuickFIX Support: http://www.quickfixengine.org/services.html


Hi Mike,

What signal this can be? I did simple tests with such sigaction:

        struct sigaction sa;
        sa.sa_handler = sigint_handler;
        sa.sa_flags = 0;
        sigemptyset(&sa.sa_mask);

        sigaction(SIGINT, &sa, NULL
        sigaction(SIGCHLD, &sa, NULL);
        sigaction(SIGHUP, &sa, NULL);

where sigint_handler is void very simple function which is called when I press Ctrl+C however seems like it doesn't handle real INT from qf which causes session logout... any thoughts?

Thx
M.


Od: "Mike Gatny" <[hidden email]>
Do: "Marcin Giedz" <[hidden email]>
DW: [hidden email]
Wysłane: wtorek, 26 marzec 2013 17:16:17
Temat: Re: [Quickfix-users] ThreadedSocketInitiator/Acceptor + Application - occasional socket errors

Looks like socket recv/send is returning EINTR, meaning that the thread received a signal during the syscall.  Are you intentionally using posix signals in your program?  If so, are you taking steps in your main program to block all signals, then explicitly handle them on one thread?  Or are you perhaps unintentionally using signals, e.g. by using sleep(3) (from unistd.h) instead of nanosleep?

--
Mike Gatny
Connamara Systems, LLC




------------------------------------------------------------------------------
Own the Future-Intel&reg; Level Up Game Demo Contest 2013
Rise to greatness in Intel's independent game demo contest.
Compete for recognition, cash, and the chance to get your game
on Steam. $5K grand prize plus 10 genre and skill prizes.
Submit your demo by 6/6/13. http://p.sf.net/sfu/intel_levelupd2d
_______________________________________________
Quickfix-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quickfix-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: ThreadedSocketInitiator/Acceptor + Application - occasional socket errors

Mike Gatny
QuickFIX Documentation: http://www.quickfixengine.org/quickfix/doc/html/index.html
QuickFIX Support: http://www.quickfixengine.org/services.html


What signal this can be? I did simple tests with such sigaction:
 
Maybe SIGALRM, SIGPIPE?  I'm not sure that sigaction is sufficient to solve this.  You need to block all signals before starting QF or any other threads -- I usually do something like this right away in main():

sigset_t blockSigs;
sigemptyset(&blockSigs);
sigaddset(&blockSigs, SIGINT);
sigaddset(&blockSigs, SIGALRM);
sigaddset(&blockSigs, SIGTERM);
sigaddset(&blockSigs, SIGPIPE);
int ret = pthread_sigmask(SIG_BLOCK, &blockSigs, 0); 

...then spawn a signal-catching thread that calls sigwait() for the sigset I want to handle.

--
Mike Gatny
Connamara Systems, LLC

------------------------------------------------------------------------------
Own the Future-Intel&reg; Level Up Game Demo Contest 2013
Rise to greatness in Intel's independent game demo contest.
Compete for recognition, cash, and the chance to get your game
on Steam. $5K grand prize plus 10 genre and skill prizes.
Submit your demo by 6/6/13. http://p.sf.net/sfu/intel_levelupd2d
_______________________________________________
Quickfix-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quickfix-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: ThreadedSocketInitiator/Acceptor + Application - occasional socket errors

lucious
QuickFIX Documentation: http://www.quickfixengine.org/quickfix/doc/html/index.html
QuickFIX Support: http://www.quickfixengine.org/services.html


Hi Mike,

it took a while but thanks a lot! In our case SIGPROF was the case.

M.



Od: "Mike Gatny" <[hidden email]>
Do: "Marcin Giedz" <[hidden email]>
DW: [hidden email]
Wysłane: wtorek, 26 marzec 2013 20:50:17
Temat: Re: [Quickfix-users] ThreadedSocketInitiator/Acceptor + Application - occasional socket errors

What signal this can be? I did simple tests with such sigaction:
 
Maybe SIGALRM, SIGPIPE?  I'm not sure that sigaction is sufficient to solve this.  You need to block all signals before starting QF or any other threads -- I usually do something like this right away in main():

sigset_t blockSigs;
sigemptyset(&blockSigs);
sigaddset(&blockSigs, SIGINT);
sigaddset(&blockSigs, SIGALRM);
sigaddset(&blockSigs, SIGTERM);
sigaddset(&blockSigs, SIGPIPE);
int ret = pthread_sigmask(SIG_BLOCK, &blockSigs, 0); 

...then spawn a signal-catching thread that calls sigwait() for the sigset I want to handle.

--
Mike Gatny
Connamara Systems, LLC



--
Pozdrawiam
Marcin Giedz
Wiceprezes Zarządu

ARISE Sp. z o.o.
mob. +48 502 537 157
mail: [hidden email]

Al. Solidarności 117
00-140 Warszawa
tel. +48 (22) 440 56 20
fax  +48 (22) 440 56 22
http://www.arise.pl

ARISE Sp. z o.o. z siedzibą w Warszawie, Al. Solidarności 117, 00-140 Warszawa, zarejestrowana przez Sąd Rejonowy dla m. st. Warszawy w Warszawie XII Wydział Gospodarczy Krajowego Rejestru Sądowego pod nr KRS 0000316860; REGON 141595449; NIP 527-259-06-10; z pokrytym w całości kapitałem zakładowym wynoszącym 250,000.00 zł.

------------------------------------------------------------------------------
Precog is a next-generation analytics platform capable of advanced
analytics on semi-structured data. The platform includes APIs for building
apps and a phenomenal toolset for data science. Developers can use
our toolset for easy data analysis & visualization. Get a free account!
http://www2.precog.com/precogplatform/slashdotnewsletter
_______________________________________________
Quickfix-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quickfix-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: ThreadedSocketInitiator/Acceptor + Application - occasional socket errors

Mike Gatny
QuickFIX Documentation: http://www.quickfixengine.org/quickfix/doc/html/index.html
QuickFIX Support: http://www.quickfixengine.org/services.html


Aha!  Thanks for posting a follow-up.


------------------------------------------------------------------------------
Precog is a next-generation analytics platform capable of advanced
analytics on semi-structured data. The platform includes APIs for building
apps and a phenomenal toolset for data science. Developers can use
our toolset for easy data analysis & visualization. Get a free account!
http://www2.precog.com/precogplatform/slashdotnewsletter
_______________________________________________
Quickfix-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quickfix-users
Loading...