Revision 4478301b
b/lib/backend.py | ||
---|---|---|
2890 | 2890 |
if cmd_suffix: |
2891 | 2891 |
cmd.append("--cmd-suffix=%s" % cmd_suffix) |
2892 | 2892 |
|
2893 |
if mode == constants.IEM_EXPORT: |
|
2894 |
# Retry connection a few times when connecting to remote peer |
|
2895 |
cmd.append("--connect-retries=%s" % constants.RIE_CONNECT_RETRIES) |
|
2896 |
cmd.append("--connect-timeout=%s" % constants.RIE_CONNECT_ATTEMPT_TIMEOUT) |
|
2897 |
elif opts.connect_timeout is not None: |
|
2898 |
assert mode == constants.IEM_IMPORT |
|
2899 |
# Overall timeout for establishing connection while listening |
|
2900 |
cmd.append("--connect-timeout=%s" % opts.connect_timeout) |
|
2901 |
|
|
2893 | 2902 |
logfile = _InstanceLogName(prefix, instance.os, instance.name) |
2894 | 2903 |
|
2895 | 2904 |
# TODO: Once _InstanceLogName uses tempfile.mkstemp, StartDaemon has |
b/lib/constants.py | ||
---|---|---|
421 | 421 |
# Remote import/export certificate validity in seconds |
422 | 422 |
RIE_CERT_VALIDITY = 24 * 60 * 60 |
423 | 423 |
|
424 |
# Remote import/export connect timeout for socat
|
|
424 |
# Overall timeout for establishing connection
|
|
425 | 425 |
RIE_CONNECT_TIMEOUT = 180 |
426 | 426 |
|
427 |
# Export only: how long to wait per connection attempt (seconds) |
|
428 |
RIE_CONNECT_ATTEMPT_TIMEOUT = 20 |
|
429 |
|
|
430 |
# Export only: number of attempts to connect |
|
431 |
RIE_CONNECT_RETRIES = 10 |
|
432 |
|
|
427 | 433 |
DISK_TEMPLATES = frozenset([DT_DISKLESS, DT_PLAIN, |
428 | 434 |
DT_DRBD8, DT_FILE]) |
429 | 435 |
|
b/lib/masterd/instance.py | ||
---|---|---|
161 | 161 |
|
162 | 162 |
self._lu = lu |
163 | 163 |
self.node_name = node_name |
164 |
self._opts = opts |
|
164 |
self._opts = opts.Copy()
|
|
165 | 165 |
self._instance = instance |
166 | 166 |
self._timeouts = timeouts |
167 | 167 |
self._cbs = cbs |
168 | 168 |
self._private = private |
169 | 169 |
|
170 |
# Set master daemon's timeout in options for import/export daemon |
|
171 |
assert self._opts.connect_timeout is None |
|
172 |
self._opts.connect_timeout = timeouts.connect |
|
173 |
|
|
170 | 174 |
# Parent loop |
171 | 175 |
self._loop = None |
172 | 176 |
|
b/lib/objects.py | ||
---|---|---|
1272 | 1272 |
@ivar ca_pem: Remote peer CA in PEM format (None for cluster certificate) |
1273 | 1273 |
@ivar compress: Compression method (one of L{constants.IEC_ALL}) |
1274 | 1274 |
@ivar magic: Used to ensure the connection goes to the right disk |
1275 |
@ivar connect_timeout: Number of seconds for establishing connection |
|
1275 | 1276 |
|
1276 | 1277 |
""" |
1277 | 1278 |
__slots__ = [ |
... | ... | |
1279 | 1280 |
"ca_pem", |
1280 | 1281 |
"compress", |
1281 | 1282 |
"magic", |
1283 |
"connect_timeout", |
|
1282 | 1284 |
] |
1283 | 1285 |
|
1284 | 1286 |
|
Also available in: Unified diff