Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HPCC-14499 Allow WsECL VIP DNS cache timeout to be configurable #9104

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 3 additions & 1 deletion esp/services/ws_ecl/ws_ecl_service.cpp
Expand Up @@ -254,13 +254,15 @@ bool CWsEclService::init(const char * name, const char * type, IPropertyTree * c
continue;
const char *vip = NULL;
bool includeTargetInURL = true;
unsigned dnsInterval = (unsigned) -1;
if (vips)
{
IPropertyTree *pc = vips->queryPropTree(xpath.clear().appendf("ProcessCluster[@name='%s']", process.str()));
if (pc)
{
vip = pc->queryProp("@vip");
includeTargetInURL = pc->getPropBool("@includeTargetInURL", true);
dnsInterval = (unsigned) pc->getPropInt("@dnsInterval", -1);

}
}
Expand All @@ -285,7 +287,7 @@ bool CWsEclService::init(const char * name, const char * type, IPropertyTree * c
if (list.length())
{
StringAttr alias(clusterInfo->getAlias());
Owned<ISmartSocketFactory> sf = new RoxieSocketFactory(list.str(), !loadBalanced, includeTargetInURL, loadBalanced ? alias.str() : NULL);
Owned<ISmartSocketFactory> sf = new RoxieSocketFactory(list.str(), !loadBalanced, includeTargetInURL, loadBalanced ? alias.str() : NULL, dnsInterval);
connMap.setValue(target.str(), sf.get());
if (alias.length() && !connMap.getValue(alias.str())) //only need one vip per alias for routing purposes
connMap.setValue(alias.str(), sf.get());
Expand Down
2 changes: 1 addition & 1 deletion esp/services/ws_ecl/ws_ecl_service.hpp
Expand Up @@ -93,7 +93,7 @@ class RoxieSocketFactory : public CSmartSocketFactory
bool includeTargetInURL;
StringAttr alias;

RoxieSocketFactory(const char *_socklist, bool _retry, bool includeTarget, const char *_alias) : CSmartSocketFactory(_socklist, _retry), includeTargetInURL(includeTarget), alias(_alias)
RoxieSocketFactory(const char *_socklist, bool _retry, bool includeTarget, const char *_alias, unsigned _dnsInterval) : CSmartSocketFactory(_socklist, _retry, 60, _dnsInterval), includeTargetInURL(includeTarget), alias(_alias)
{
}
};
Expand Down
8 changes: 7 additions & 1 deletion initfiles/componentfiles/configxml/@temp/esp_service.xsl
Expand Up @@ -912,7 +912,13 @@ xmlns:seisint="http://seisint.com" xmlns:set="http://exslt.org/sets" exclude-re
<xsl:otherwise>true</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<ProcessCluster name="{$roxie}" vip="{$vip}" includeTargetInURL="{$sendTarget}"></ProcessCluster>
<xsl:variable name="dnsInterval">
<xsl:choose>
<xsl:when test="@dnsInterval and @dnsInterval!=''"><xsl:value-of select="@dnsInterval"/></xsl:when>
<xsl:otherwise>-1</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<ProcessCluster name="{$roxie}" vip="{$vip}" includeTargetInURL="{$sendTarget}" dnsInterval="{$dnsInterval}"></ProcessCluster>
</xsl:if>
</xsl:for-each>
</VIPS>
Expand Down
11 changes: 10 additions & 1 deletion initfiles/componentfiles/configxml/esp_service_wsecl2.xsd
Expand Up @@ -58,12 +58,21 @@
</xs:appinfo>
</xs:annotation>
</xs:attribute>
<xs:attribute name="dnsInterval" type="xs:integer" use="optional" default="-1">
<xs:annotation>
<xs:appinfo>
<tooltip>DNS lookup cache timeout in seconds. Set to 0 to resolve DNS for every transaction. Set to -1 (default) to keep DNS lookup cached indefinitely.</tooltip>
<title>DNS Cache timeout interval</title>
<colIndex>3</colIndex>
</xs:appinfo>
</xs:annotation>
</xs:attribute>
<xs:attribute name="sendTargetToRoxie" use="optional" default="true">
<xs:annotation>
<xs:appinfo>
<tooltip>Send roxie the target from which to run query (disable for backward compatibility issues)</tooltip>
<title>Send Target To Roxie</title>
<colIndex>3</colIndex>
<colIndex>4</colIndex>
</xs:appinfo>
</xs:annotation>
<xs:simpleType>
Expand Down