Skip to content

Commit

Permalink
IceGrid fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
bernardnormier committed Apr 20, 2024
1 parent f26a299 commit 618fa3c
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 10 deletions.
5 changes: 2 additions & 3 deletions cpp/src/IceGrid/Client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -304,11 +304,10 @@ run(const Ice::StringSeq& args)
{
if (!host.empty())
{
const int timeout = 3000; // 3s connection timeout.
ostringstream os;
os << "Ice/LocatorFinder" << (ssl ? " -s" : "");
os << ":tcp -h \"" << host << "\" -p " << (port == 0 ? 4061 : port) << " -t " << timeout;
os << ":ssl -h \"" << host << "\" -p " << (port == 0 ? 4062 : port) << " -t " << timeout;
os << ":tcp -h \"" << host << "\" -p " << (port == 0 ? 4061 : port);
os << ":ssl -h \"" << host << "\" -p " << (port == 0 ? 4062 : port);
Ice::LocatorFinderPrx finder{communicator, os.str()};
try
{
Expand Down
5 changes: 3 additions & 2 deletions cpp/src/IceGrid/InternalRegistryI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,11 @@ InternalRegistryI::InternalRegistryI(
_session(session)
{
auto properties = database->getCommunicator()->getProperties();
// TODO: temporary. For now, synchronized with the default idle timeout.
_nodeSessionTimeout =
chrono::seconds(properties->getPropertyAsIntWithDefault("IceGrid.Registry.NodeSessionTimeout", 30));
chrono::seconds(properties->getPropertyAsIntWithDefault("IceGrid.Registry.NodeSessionTimeout", 60));
_replicaSessionTimeout =
chrono::seconds(properties->getPropertyAsIntWithDefault("IceGrid.Registry.ReplicaSessionTimeout", 30));
chrono::seconds(properties->getPropertyAsIntWithDefault("IceGrid.Registry.ReplicaSessionTimeout", 60));
_requireNodeCertCN = properties->getPropertyAsIntWithDefault("IceGrid.Registry.RequireNodeCertCN", 0);
_requireReplicaCertCN = properties->getPropertyAsIntWithDefault("IceGrid.Registry.RequireReplicaCertCN", 0);
}
Expand Down
10 changes: 7 additions & 3 deletions cpp/src/IceGrid/RegistryI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,9 @@ RegistryI::startImpl()

_replicaName = properties->getPropertyWithDefault("IceGrid.Registry.ReplicaName", "Master");
_master = _replicaName == "Master";
_sessionTimeout = chrono::seconds(properties->getPropertyAsIntWithDefault("IceGrid.Registry.SessionTimeout", 30));

// TODO: temporary. For now, synchronized with the default idle timeout.
_sessionTimeout = chrono::seconds(properties->getPropertyAsIntWithDefault("IceGrid.Registry.SessionTimeout", 60));

if (!_initFromReplica.empty() && (_initFromReplica == _replicaName || (_master && _initFromReplica == "Master")))
{
Expand Down Expand Up @@ -1087,8 +1089,10 @@ RegistryI::getSessionTimeout(const Ice::Current&) const
int
RegistryI::getACMTimeout(const Ice::Current&) const
{
// TODO: return the idle timeout
return 60;
// TODO: better way to retrieve idle timeout
auto properties = _communicator->getProperties();
int idleTimeout = properties->getPropertyAsIntWithDefault("Ice.Connection.IdleTimeout", 60);
return properties->getPropertyAsIntWithDefault("IceGrid.Registry.Client.Connection.IdleTimeout", idleTimeout);
}

string
Expand Down
2 changes: 1 addition & 1 deletion scripts/tests/Glacier2/application.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@
from Glacier2Util import Glacier2TestSuite


Glacier2TestSuite(__name__, routerProps={"Glacier2.SessionTimeout": 30})
Glacier2TestSuite(__name__, routerProps={"Glacier2.Client.Connection.IdleTimeout": 30})
2 changes: 1 addition & 1 deletion scripts/tests/Glacier2/sessionHelper.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@
from Glacier2Util import Glacier2TestSuite


Glacier2TestSuite(__name__, routerProps={"Glacier2.Client.ACM.Timeout": 30})
Glacier2TestSuite(__name__, routerProps={"Glacier2.Client.Connection.IdleTimeout": 30})

0 comments on commit 618fa3c

Please sign in to comment.