How do retries work for data connectors?
Lawlor-Bagcal, Kyle
kl3020 at tc.columbia.edu
Tue Mar 30 17:52:25 UTC 2021
Hello,
I want to better understand how retries of a data connector work in
shibboleth.
*Example code:*
>From the attributes resolver file:
<!-- Primary -->
<DataConnector id="myDatabase" noRetryDelay="PT30S"
xsi:type="RelationalDatabase"
validatorRef="shibboleth.NonFailFastValidator">
<BeanManagedConnection>OracleDBdataSource</BeanManagedConnection>
<FailoverDataConnector ref="FailoverAWSmysql" />
<QueryTemplate>
.... redacted SQL query for getting some attributes...
</QueryTemplate>
<Column columnName="...." attributeID="...." />
<ResultCache elementTimeToLive="PT60S"/>
</DataConnector>
<!-- Failover -->
<DataConnector id="FailoverAWSmysql" xsi:type="RelationalDatabase"
validatorRef="shibboleth.NonFailFastValidator">
<BeanManagedConnection>MySQLdataSource</BeanManagedConnection>
<QueryTemplate>
.... redacted
</QueryTemplate>
<Column columnName="...." attributeID="...." />
.... redacted ....
<ResultCache elementTimeToLive="PT60S"/>
</DataConnector>
from conf/global.xml:
<bean id="hikariConfig" class="com.zaxxer.hikari.HikariConfig">
<property name="poolName" value="springHikariCP" />
<property name="connectionTimeout" value="2000" />
<property name="validationTimeout" value="1000" />
<property name="maximumPoolSize" value="20" />
<property name="dataSourceClassName"
value="oracle.jdbc.pool.OracleDataSource" />
<property name="dataSourceProperties">
<props>
.... redacted ....
</props>
</property>
</bean>
<bean id="hikariConfigMySQL" class="com.zaxxer.hikari.HikariConfig">
<property name="poolName" value="springHikariCPmysql" />
<property name="connectionTimeout" value="10000" />
<property name="maximumPoolSize" value="20" />
<property name="dataSourceClassName"
value="com.mysql.jdbc.jdbc2.optional.MysqlDataSource" />
<property name="dataSourceProperties">
<props>
.... redacted ....
</props>
</property>
</bean>
*Scenario:*
1. Let's say the shibboleth app is trying to get attributes from the
primary data connector.
2. Assume a thread grabs a connection from the primary HikariCP but upon
execution the ResolutionException is raised.
*Questions:*
- After #2 occurs, what happens next? Does the thread pause for 30
seconds (noRetryDelay) to retry the primary connector? Or does it
immediately go to the failover data connector and then pending the result
of that lookup, it may or may not retry the entire path?
- How many times will the data connector retry? Is there a limit? Where
is the limit set? Is it hard coded?
- Is it true that the only exception that the retry or failover logic
responds to is the ResolutionException
<https://git.shibboleth.net/view/?p=java-identity-provider.git;a=blob;f=idp-attribute-resolver-impl/src/main/java/net/shibboleth/idp/attribute/resolver/dc/rdbms/impl/RDBMSDataConnector.java;hb=28bccab21a065a57c4f03cd34da4011b5b9dca9f#l154>
(for data connectors)?
If we can keep the answers scoped to my example code above that would be
helpful for me to understand it better.
Thanks,
--
Kyle Lawlor-Bagcal, Web and Mobile Team Lead
Teachers College Information Technology (TCIT)
Teachers College | Columbia University
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://shibboleth.net/pipermail/users/attachments/20210330/8a7e681f/attachment.htm>
More information about the users
mailing list