Select calls and FD_SET grreater than or equal to 1024
Hi,
We would like to know if there is an alternative and to
not do select calls?
We would like to know if Reuters is adding a socket to
select list for sockets descriptors greater than or equal to 1024?
As shown below in the threading and strace output we
believe this is causing us issues:
Thread output:
#20x00007f5ab6c4c71e in onload_select (nfds=1024, rds=0x7f59621fafe0,
wrs=0x7f59621faf60, exs=0x7f59621faee0, timeout=0x7f59621fb060) at
../../../../../src/lib/transport/unix/sockcall_intercept.c:1160
lib_context
= {thread = 0x7f59621fbb20, saved_errno = 115}
timeout_ms
= 1
used_ms = 0
rc =
#30x00007f5aa8385e17 in RTRSelectNotifier::enable() () from
/opt/srlabs/smds/builds/ms-eur-smds-4.0.8.700//md-3rd/reuters_mapi/libs751/RHEL5_64_GCC412/libRFA_SessionLayer.so
No symbol table info available.
#40x00007f5aa836d09f in rfa: (worry) essionLayer: (worry)
essionImpl::runThread() () from
/opt/srlabs/smds/builds/ms-eur-smds-4.0.8.700//md-3rd/reuters_mapi/libs751/RHEL5_64_GCC412/libRFA_SessionLayer.so
No symbol table info available.
#50x00007f5aa8d55f27 in rfa: (worry) upport::Thread: (worry)
tartWrapper(void*) () from
/opt/srlabs/smds/builds/ms-eur-smds-4.0.8.700//md-3rd/reuters_mapi/libs751/RHEL5_64_GCC412/libDacs.so.7
No symbol table info available.
#60x0000003bb36079d1 in start_thread () from /lib64/libpthread.so.0 No
symbol table info available.
#70x0000003bb32e88fd in clone () from /lib64/libc.so.6 No symbol table
info available.
strace output:
No Title
[a.bhise@dnjsvdev03v
0630_mergedProfile_TCP_Not_Acclerated_Breaks]$ grep "10.175.181.40"
strace.out
23879 14:13:16.527338 connect(1030, {sa_family=AF_INET,
sin_port=htons(14002), sin_addr=inet_addr("10.175.181.40")}, 16
23879 14:13:31.553478 connect(1131, {sa_family=AF_INET,
sin_port=htons(14002), sin_addr=inet_addr("10.175.181.40")}, 16
23879 14:13:46.565700 connect(1083, {sa_family=AF_INET,
sin_port=htons(14002), sin_addr=inet_addr("10.175.181.40")}, 16
23879 14:14:01.582052 connect(1162, {sa_family=AF_INET,
sin_port=htons(14002), sin_addr=inet_addr("10.175.181.40")}, 16
23879 14:14:16.599886 connect(1175, {sa_family=AF_INET,
sin_port=htons(14002), sin_addr=inet_addr("10.175.181.40")}, 16
23879 14:14:31.612650 connect(1191, {sa_family=AF_INET,
sin_port=htons(14002), sin_addr=inet_addr("10.175.181.40")}, 16
23879 14:14:46.625023 connect(1203, {sa_family=AF_INET,
sin_port=htons(14002), sin_addr=inet_addr("10.175.181.40")}, 16
23879 14:15:01.642350 connect(1213, {sa_family=AF_INET,
sin_port=htons(14002), sin_addr=inet_addr("10.175.181.40")}, 16
23879 14:15:16.667858 connect(1219, {sa_family=AF_INET,
sin_port=htons(14002), sin_addr=inet_addr("10.175.181.40")}, 16
Also Just to add some context here, we are seeing reuters
making select calls and adding socket to FD_SET higher than 1024. If the
library attempts to add an fd that is greater than the limit to the fdset then
the behaviour is undefined, and won't necessarily result in what's being passed
to the select call itself being wrong, but could, for example, result in other
memory in the application being corrupted. Unfortunately, because this happens
at fdset creation, so before the call to select, it's not visible at the point
at which onload sees the select call, so we can't add instrumentation that
would detect this.
That means that we need confirmation from the library
whether it may be violating the restrictions on the use of fdset. So it would
be helpful if you could confirm with the providers of the library whether or not
they may be passing an invalid value to FD_SET.
Best Answer
-
Hi @sgarland
I believe this is a known issue and has already been fixed in RFA C++ 7.6.1.E1
Here is the detail from README
-----------------------------
rfa7.6.1.E1.win-shared
-----------------------------
cxxut0458; RFA fails to connect when more than 1024 FDs are used
RFA application cannot connect to any host when file descriptor number exceed 1024.RFA now use use fd_set sized to match the maximum number of file descriptors allowed by the operating system.
Are you using the latest version?
0
Answers
-
Thanks @Warat B
This confirms that RFA was not checking prior to 7.6.1.E1
however the question now is, is there an alternative? Now that RFA checks it'll
fail when file descriptor number exceeds 1024 (which is better than hanging in
connect) however on a large application there
is no guarantee that RFA will be able to connect if >1024 descriptors are already in use. Really an alternative to select such as poll is required.0 -
That's correct @cmason, which is why Elektron API use poll.
If you suspect that your application will use more that 1024 descriptors, I would suggest using Elektron API over RFA.
0
Categories
- All Categories
- 3 Polls
- 6 AHS
- 36 Alpha
- 166 App Studio
- 6 Block Chain
- 4 Bot Platform
- 18 Connected Risk APIs
- 47 Data Fusion
- 34 Data Model Discovery
- 690 Datastream
- 1.4K DSS
- 629 Eikon COM
- 5.2K Eikon Data APIs
- 11 Electronic Trading
- 1 Generic FIX
- 7 Local Bank Node API
- 3 Trading API
- 2.9K Elektron
- 1.4K EMA
- 255 ETA
- 559 WebSocket API
- 39 FX Venues
- 15 FX Market Data
- 1 FX Post Trade
- 1 FX Trading - Matching
- 12 FX Trading – RFQ Maker
- 5 Intelligent Tagging
- 2 Legal One
- 25 Messenger Bot
- 3 Messenger Side by Side
- 9 ONESOURCE
- 7 Indirect Tax
- 60 Open Calais
- 279 Open PermID
- 45 Entity Search
- 2 Org ID
- 1 PAM
- PAM - Logging
- 6 Product Insight
- Project Tracking
- ProView
- ProView Internal
- 23 RDMS
- 2K Refinitiv Data Platform
- 716 Refinitiv Data Platform Libraries
- 4 LSEG Due Diligence
- LSEG Due Diligence Portal API
- 4 Refinitiv Due Dilligence Centre
- Rose's Space
- 1.2K Screening
- 18 Qual-ID API
- 13 Screening Deployed
- 23 Screening Online
- 12 World-Check Customer Risk Screener
- 1K World-Check One
- 46 World-Check One Zero Footprint
- 45 Side by Side Integration API
- 2 Test Space
- 3 Thomson One Smart
- 10 TR Knowledge Graph
- 151 Transactions
- 143 REDI API
- 1.8K TREP APIs
- 4 CAT
- 27 DACS Station
- 121 Open DACS
- 1.1K RFA
- 106 UPA
- 194 TREP Infrastructure
- 229 TRKD
- 918 TRTH
- 5 Velocity Analytics
- 9 Wealth Management Web Services
- 95 Workspace SDK
- 11 Element Framework
- 5 Grid
- 19 World-Check Data File
- 1 Yield Book Analytics
- 48 中文论坛