Bug 61128 - Allow cluster manager mapSendOptions to be specified with verbose, human-readable names
Summary: Allow cluster manager mapSendOptions to be specified with verbose, human-read...
Status: RESOLVED DUPLICATE of bug 61127
Alias: None
Product: Tomcat 9
Classification: Unclassified
Component: Catalina (show other bugs)
Version: unspecified
Hardware: All All
: P2 enhancement (vote)
Target Milestone: -----
Assignee: Tomcat Developers Mailing List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-05-26 20:49 UTC by Christopher Schultz
Modified: 2017-06-21 19:39 UTC (History)
1 user (show)



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Christopher Schultz 2017-05-26 20:49:54 UTC
Cluster managers support "mapSendOptions" which is specified as an integer value, bitwise-ORd from the individual bits which make-up the various options.

The default value is 8 for the DeltaManager which means "asynchronous".

It would be nice if the configuration could use human-readable options like "async" instead of "8".

These are the channel send options available:

SEND_OPTIONS_ASYNCHRONOUS
SEND_OPTIONS_BYTE_MESSAGE
SEND_OPTIONS_MULTICAST
SEND_OPTIONS_SECURE
SEND_OPTIONS_SYNCHRONIZED_ACK
SEND_OPTIONS_UDP
SEND_OPTIONS_USE_ACK

They could be specified as human-readable strings e.g. mapSendOptions="async,multicast" instead of mapSendOptions="72" which would make the configuration much easier to both read and write.

For backward compatibility, the integer values should also be acceptable.

This bug is nearly the same as bug #61127, but on a different component.
Comment 1 Igal Sapir 2017-05-28 22:36:05 UTC
Please see https://github.com/apache/tomcat/pull/56 as a WIP.

Especially given the fact that this is my first PR I would need more feedback.
Comment 2 Igal Sapir 2017-05-29 22:08:21 UTC
Chris,

https://github.com/apache/tomcat/pull/56/files should take care of #61127, but where do you set "mapSendOptions"?

I see `public void setMapSendOptions(int mapSendOptions)` in 3 classes:

* BackupManager
* ClusterSingleSignOn  
* ReplicatedContext

The "fix" should be to add another method that takes a String input, as follows:

    public void setMapSendOptions(String mapSendOptions) {

        int value = Channel.parseChannelSendOptions(mapSendOptions);
        if (value > 0)
            this.setMapSendOptions(value);
    }

But... Do all 3 of them use that?  TBH I'm not sure and I've never set up a Cluster in Tomcat so I don't know if I should add those or not.  For example, are those used in config elements like "Cluster" in server.xml?  I can't find anything about that.
Comment 3 Christopher Schultz 2017-06-21 19:39:54 UTC

*** This bug has been marked as a duplicate of bug 61127 ***