Skip to content

Commit f2bd997

Browse files
Merge pull request #195 from martin-belanger/sticky
conf: Enable sticky-connections by default
2 parents 70a1fb2 + 11f5f75 commit f2bd997

File tree

7 files changed

+17
-8
lines changed

7 files changed

+17
-8
lines changed

NEWS.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
- Fix issues with I/O controller connection audits
66
- Eliminate pcie devices from list of I/O controller connections to audit
77
- Add soaking timer to workaround race condition between kernel and user-space applications on "add" uevents. When the kernel adds a new nvme device (e.g. `/dev/nvme7`) and sends a "add" uevent to notify user-space applications, the attributes associated with that device (e.g. `/sys/class/nvme/nvme7/cntrltype`) may not be fully initialized which can lead `stacd` to dismiss a device that should get audited.
8+
- Make `sticky-connections=enabled` the default (see `stacd.conf`)
89

910
## Changes with release 1.1.5
1011

@@ -32,7 +33,7 @@ stacd: Bug fix. Check that self._cfg_soak_tmr is not None before dereferencing i
3233

3334
## Changes with release 1.1.1
3435

35-
Make `sticky-connections-disabled` by default
36+
Make `sticky-connections=disabled` the default (see `stacd.conf`)
3637

3738
## Changes with release 1.1
3839

doc/man/stacd.conf.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -378,7 +378,7 @@
378378
entries in <filename>stacd.conf</filename> have been removed.
379379
</para>
380380

381-
<formalpara><title>With <code>sticky-connections=disabled</code> (default)</title>
381+
<formalpara><title>With <code>sticky-connections=disabled</code></title>
382382
<para>
383383
<code>stacd</code> immediately disconnects from
384384
a previously connected IOC if the response to a
@@ -411,7 +411,7 @@
411411
</formalpara>
412412
</formalpara>
413413

414-
<formalpara><title>With <code>sticky-connections=enabled</code></title>
414+
<formalpara><title>With <code>sticky-connections=enabled (default)</code></title>
415415
<para>
416416
<code>stacd</code> does not disconnect from IOCs
417417
when a DPLE is removed or a <literal>controller=</literal>

etc/stas/stacd.conf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -202,8 +202,8 @@
202202
#
203203
# Type: String
204204
# Range: [disabled, enabled]
205-
# Default: disabled
206-
#sticky-connections=disabled
205+
# Default: enabled
206+
#sticky-connections=enabled
207207

208208
[Controllers]
209209
# controller: I/O Controllers (IOC) are specified with this keyword.

staslib/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ def __init__(self, conf_file='/dev/null'):
7474
('Global', 'ignore-iface'): 'false',
7575
('Global', 'ip-family'): 'ipv4+ipv6',
7676
('Global', 'udev-rule'): 'enabled',
77-
('Global', 'sticky-connections'): 'disabled',
77+
('Global', 'sticky-connections'): 'enabled',
7878
('Service Discovery', 'zeroconf'): 'enabled',
7979
('Controllers', 'controller'): list(),
8080
('Controllers', 'blacklist'): list(),

staslib/ctrl.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,11 @@ def controller_id_dict(self) -> dict:
6161
def details(self) -> dict:
6262
'''@brief return detailed debug info about this controller'''
6363
details = super().details()
64-
details.update(self._udev.get_attributes(self.device, ('hostid', 'hostnqn', 'model', 'serial')))
64+
details.update(
65+
self._udev.get_attributes(self.device,
66+
('hostid', 'hostnqn', 'model',
67+
'serial', 'dctype', 'cntrltype'))
68+
)
6569
return details
6670

6771
def info(self) -> dict:

test/test-config.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ def test_config(self):
4040
self.assertFalse(service_conf.data_digest)
4141
self.assertTrue(service_conf.persistent_connections)
4242
self.assertTrue(service_conf.udev_rule_enabled)
43-
self.assertFalse(service_conf.sticky_connections)
43+
self.assertTrue(service_conf.sticky_connections)
4444
self.assertFalse(service_conf.ignore_iface)
4545
self.assertIn(6, service_conf.ip_family)
4646
self.assertNotIn(4, service_conf.ip_family)

test/test-controller.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,8 @@ def test_get_device(self):
8181
self.assertEqual(
8282
controller.details(),
8383
{
84+
'dctype': '',
85+
'cntrltype': '',
8486
'transport': 'tcp',
8587
'traddr': '10.10.10.10',
8688
'trsvcid': '8009',
@@ -99,6 +101,8 @@ def test_get_device(self):
99101
self.assertEqual(
100102
controller.info(),
101103
{
104+
'dctype': '',
105+
'cntrltype': '',
102106
'transport': 'tcp',
103107
'traddr': '10.10.10.10',
104108
'trsvcid': '8009',

0 commit comments

Comments
 (0)