Skip to content

Commit

Permalink
Issue #2717 remove workerName as request attribute
Browse files Browse the repository at this point in the history
  • Loading branch information
janbartel committed Jan 15, 2025
1 parent 4f0b2c6 commit ff44b13
Showing 1 changed file with 1 addition and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ public class DefaultSessionIdManager extends ContainerLifeCycle implements Sessi
protected Random _random;
protected boolean _weakRandom;
protected String _workerName;
protected String _workerAttr;
protected long _reseed = 100000L;
protected Server _server;
protected HouseKeeper _houseKeeper;
Expand Down Expand Up @@ -134,9 +133,6 @@ public String getWorkerName()
/**
* Set the workername. If set, the workername is dot appended to the session
* ID and can be used to assist session affinity in a load balancer.
* A worker name starting with $ is used as a request attribute name to
* lookup the worker name that can be dynamically set by a request
* Customizer.
*
* @param workerName the name of the worker, if null it is coerced to empty string
*/
Expand Down Expand Up @@ -315,8 +311,6 @@ protected void doStart() throws Exception
_workerName = "node" + (inst == null ? "0" : inst);
}

_workerAttr = _workerName.startsWith("$") ? _workerName.substring(1) : null;

if (_houseKeeper == null)
{
_ownHouseKeeper = true;
Expand Down Expand Up @@ -377,12 +371,7 @@ public String getExtendedId(String clusterId, Request request)
{
if (!StringUtil.isBlank(_workerName))
{
if (_workerAttr == null)
return clusterId + '.' + _workerName;

String worker = (String)request.getAttribute(_workerAttr);
if (worker != null)
return clusterId + '.' + worker;
return clusterId + '.' + _workerName;
}

return clusterId;
Expand Down

0 comments on commit ff44b13

Please sign in to comment.