This file is indexed.

/usr/lib/python2.7/dist-packages/oslo_messaging/_drivers/zmq_driver/zmq_options.py is in python-oslo.messaging 5.35.0-0ubuntu1.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
#    Copyright 2016 Mirantis, Inc.
#
#    Licensed under the Apache License, Version 2.0 (the "License"); you may
#    not use this file except in compliance with the License. You may obtain
#    a copy of the License at
#
#         http://www.apache.org/licenses/LICENSE-2.0
#
#    Unless required by applicable law or agreed to in writing, software
#    distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
#    License for the specific language governing permissions and limitations
#    under the License.

import socket

from oslo_config import cfg

from oslo_messaging._drivers import base
from oslo_messaging._drivers import common
from oslo_messaging import server


MATCHMAKER_BACKENDS = ('redis', 'sentinel', 'dummy')
MATCHMAKER_DEFAULT = 'redis'


zmq_opts = [
    cfg.StrOpt('rpc_zmq_bind_address', default='*',
               deprecated_group='DEFAULT',
               help='ZeroMQ bind address. Should be a wildcard (*), '
                    'an ethernet interface, or IP. '
                    'The "host" option should point or resolve to this '
                    'address.'),

    cfg.StrOpt('rpc_zmq_matchmaker', default=MATCHMAKER_DEFAULT,
               choices=MATCHMAKER_BACKENDS,
               deprecated_group='DEFAULT',
               help='MatchMaker driver.'),

    cfg.IntOpt('rpc_zmq_contexts', default=1,
               deprecated_group='DEFAULT',
               help='Number of ZeroMQ contexts, defaults to 1.'),

    cfg.IntOpt('rpc_zmq_topic_backlog',
               deprecated_group='DEFAULT',
               help='Maximum number of ingress messages to locally buffer '
                    'per topic. Default is unlimited.'),

    cfg.StrOpt('rpc_zmq_ipc_dir', default='/var/run/openstack',
               deprecated_group='DEFAULT',
               help='Directory for holding IPC sockets.'),

    cfg.StrOpt('rpc_zmq_host', default=socket.gethostname(),
               sample_default='localhost',
               deprecated_group='DEFAULT',
               help='Name of this node. Must be a valid hostname, FQDN, or '
                    'IP address. Must match "host" option, if running Nova.'),

    cfg.IntOpt('zmq_linger', default=-1,
               deprecated_group='DEFAULT',
               deprecated_name='rpc_cast_timeout',
               help='Number of seconds to wait before all pending '
                    'messages will be sent after closing a socket. '
                    'The default value of -1 specifies an infinite linger '
                    'period. The value of 0 specifies no linger period. '
                    'Pending messages shall be discarded immediately '
                    'when the socket is closed. Positive values specify an '
                    'upper bound for the linger period.'),

    cfg.IntOpt('rpc_poll_timeout', default=1,
               deprecated_group='DEFAULT',
               help='The default number of seconds that poll should wait. '
                    'Poll raises timeout exception when timeout expired.'),

    cfg.IntOpt('zmq_target_expire', default=300,
               deprecated_group='DEFAULT',
               help='Expiration timeout in seconds of a name service record '
                    'about existing target ( < 0 means no timeout).'),

    cfg.IntOpt('zmq_target_update', default=180,
               deprecated_group='DEFAULT',
               help='Update period in seconds of a name service record '
                    'about existing target.'),

    cfg.BoolOpt('use_pub_sub', default=False,
                deprecated_group='DEFAULT',
                help='Use PUB/SUB pattern for fanout methods. '
                     'PUB/SUB always uses proxy.'),

    cfg.BoolOpt('use_router_proxy', default=False,
                deprecated_group='DEFAULT',
                help='Use ROUTER remote proxy.'),

    cfg.BoolOpt('use_dynamic_connections', default=False,
                help='This option makes direct connections dynamic or static. '
                     'It makes sense only with use_router_proxy=False which '
                     'means to use direct connections for direct message '
                     'types (ignored otherwise).'),

    cfg.IntOpt('zmq_failover_connections', default=2,
               help='How many additional connections to a host will be made '
                    'for failover reasons. This option is actual only in '
                    'dynamic connections mode.'),

    cfg.PortOpt('rpc_zmq_min_port',
                default=49153,
                deprecated_group='DEFAULT',
                help='Minimal port number for random ports range.'),

    cfg.IntOpt('rpc_zmq_max_port',
               min=1,
               max=65536,
               default=65536,
               deprecated_group='DEFAULT',
               help='Maximal port number for random ports range.'),

    cfg.IntOpt('rpc_zmq_bind_port_retries',
               default=100,
               deprecated_group='DEFAULT',
               help='Number of retries to find free port number before '
                    'fail with ZMQBindError.'),

    cfg.StrOpt('rpc_zmq_serialization', default='json',
               choices=('json', 'msgpack'),
               deprecated_group='DEFAULT',
               help='Default serialization mechanism for '
                    'serializing/deserializing outgoing/incoming messages'),

    cfg.BoolOpt('zmq_immediate', default=True,
                help='This option configures round-robin mode in zmq socket. '
                     'True means not keeping a queue when server side '
                     'disconnects. False means to keep queue and messages '
                     'even if server is disconnected, when the server '
                     'appears we send all accumulated messages to it.'),

    cfg.IntOpt('zmq_tcp_keepalive', default=-1,
               help='Enable/disable TCP keepalive (KA) mechanism. '
                    'The default value of -1 (or any other negative value) '
                    'means to skip any overrides and leave it to OS default; '
                    '0 and 1 (or any other positive value) mean to '
                    'disable and enable the option respectively.'),

    cfg.IntOpt('zmq_tcp_keepalive_idle', default=-1,
               help='The duration between two keepalive transmissions in '
                    'idle condition. '
                    'The unit is platform dependent, for example, '
                    'seconds in Linux, milliseconds in Windows etc. '
                    'The default value of -1 (or any other negative value '
                    'and 0) means to skip any overrides and leave it '
                    'to OS default.'),

    cfg.IntOpt('zmq_tcp_keepalive_cnt', default=-1,
               help='The number of retransmissions to be carried out before '
                    'declaring that remote end is not available. '
                    'The default value of -1 (or any other negative value '
                    'and 0) means to skip any overrides and leave it '
                    'to OS default.'),

    cfg.IntOpt('zmq_tcp_keepalive_intvl', default=-1,
               help='The duration between two successive keepalive '
                    'retransmissions, if acknowledgement to the previous '
                    'keepalive transmission is not received. '
                    'The unit is platform dependent, for example, '
                    'seconds in Linux, milliseconds in Windows etc. '
                    'The default value of -1 (or any other negative value '
                    'and 0) means to skip any overrides and leave it '
                    'to OS default.'),

    cfg.IntOpt('rpc_thread_pool_size', default=100,
               help='Maximum number of (green) threads to work concurrently.'),

    cfg.IntOpt('rpc_message_ttl', default=300,
               help='Expiration timeout in seconds of a sent/received message '
                    'after which it is not tracked anymore by a '
                    'client/server.'),

    cfg.BoolOpt('rpc_use_acks', default=False,
                help='Wait for message acknowledgements from receivers. '
                     'This mechanism works only via proxy without PUB/SUB.'),

    cfg.IntOpt('rpc_ack_timeout_base', default=15,
               help='Number of seconds to wait for an ack from a cast/call. '
                    'After each retry attempt this timeout is multiplied by '
                    'some specified multiplier.'),

    cfg.IntOpt('rpc_ack_timeout_multiplier', default=2,
               help='Number to multiply base ack timeout by after each retry '
                    'attempt.'),

    cfg.IntOpt('rpc_retry_attempts', default=3,
               help='Default number of message sending attempts in case '
                    'of any problems occurred: positive value N means '
                    'at most N retries, 0 means no retries, None or -1 '
                    '(or any other negative values) mean to retry forever. '
                    'This option is used only if acknowledgments are '
                    'enabled.'),

    cfg.ListOpt('subscribe_on',
                default=[],
                help='List of publisher hosts SubConsumer can subscribe on. '
                     'This option has higher priority then the default '
                     'publishers list taken from the matchmaker.'),
]


def register_opts(conf, url):
    opt_group = cfg.OptGroup(name='oslo_messaging_zmq',
                             title='ZeroMQ driver options')
    conf.register_opts(zmq_opts, group=opt_group)
    conf.register_opts(server._pool_opts)
    conf.register_opts(base.base_opts)
    return common.ConfigOptsProxy(conf, url, opt_group.name)