From 18bb7de8908248e80ce0caaa3517e0cb0974d35a Mon Sep 17 00:00:00 2001 From: Georgy Moiseev Date: Fri, 11 Nov 2022 13:34:41 +0300 Subject: [PATCH] internal: drop graceful shutdown feature flag Graceful shutdown was introduced in Tarantool with [1]. A week later it was reworked with [2]. So the timeline is as follows. - Graceful shutdown is introduced, new feature flag is added and the protocol version is bumped to 4. - Graceful shutdown is reworked, feature flag is dropped and the protocol version is dropped to 3. - Next Tarantool version released. So the idea for users is "IPROTO_FEATURE_GRACEFUL_SHUTDOWN and protocol version 4 never existed". It also means that any new feature flag may have value `4` (same as IPROTO_FEATURE_GRACEFUL_SHUTDOWN), but with completely different meaning. IPROTO_FEATURE_GRACEFUL_SHUTDOWN flag was added in [3] by mistake due to misunderstanding the event timeline. This patch removes the flag. Since `_features` dict is an internal of a connection object, the change shouldn't break anything for users. 1. https://github.com/tarantool/tarantool/commit/6f29f9d7725331d74d5e9a57a4922b1c3801ad50 2. https://github.com/tarantool/tarantool/commit/2e9cbec3091e7c5d6ca1d7dad4305333e70f5876 3. https://github.com/tarantool/tarantool-python/pull/243 Closes #262 --- tarantool/connection.py | 2 -- tarantool/const.py | 1 - test/suites/test_protocol.py | 2 -- 3 files changed, 5 deletions(-) diff --git a/tarantool/connection.py b/tarantool/connection.py index 5b4fe608..5849994c 100644 --- a/tarantool/connection.py +++ b/tarantool/connection.py @@ -63,7 +63,6 @@ IPROTO_FEATURE_TRANSACTIONS, IPROTO_FEATURE_ERROR_EXTENSION, IPROTO_FEATURE_WATCHERS, - IPROTO_FEATURE_GRACEFUL_SHUTDOWN, IPROTO_CHUNK, ) from tarantool.error import ( @@ -514,7 +513,6 @@ def __init__(self, host, port, IPROTO_FEATURE_TRANSACTIONS: False, IPROTO_FEATURE_ERROR_EXTENSION: False, IPROTO_FEATURE_WATCHERS: False, - IPROTO_FEATURE_GRACEFUL_SHUTDOWN: False, } if connect_now: diff --git a/tarantool/const.py b/tarantool/const.py index 4843c387..4ea61444 100644 --- a/tarantool/const.py +++ b/tarantool/const.py @@ -96,7 +96,6 @@ IPROTO_FEATURE_TRANSACTIONS = 1 IPROTO_FEATURE_ERROR_EXTENSION = 2 IPROTO_FEATURE_WATCHERS = 3 -IPROTO_FEATURE_GRACEFUL_SHUTDOWN = 4 # Default value for connection timeout (seconds) CONNECTION_TIMEOUT = None diff --git a/test/suites/test_protocol.py b/test/suites/test_protocol.py index f1902afc..6a548e4f 100644 --- a/test/suites/test_protocol.py +++ b/test/suites/test_protocol.py @@ -13,7 +13,6 @@ IPROTO_FEATURE_TRANSACTIONS, IPROTO_FEATURE_ERROR_EXTENSION, IPROTO_FEATURE_WATCHERS, - IPROTO_FEATURE_GRACEFUL_SHUTDOWN, ) class TestSuite_Protocol(unittest.TestCase): @@ -86,7 +85,6 @@ def test_04_protocol(self): self.assertEqual(self.con._features[IPROTO_FEATURE_STREAMS], False) self.assertEqual(self.con._features[IPROTO_FEATURE_TRANSACTIONS], False) self.assertEqual(self.con._features[IPROTO_FEATURE_WATCHERS], False) - self.assertEqual(self.con._features[IPROTO_FEATURE_GRACEFUL_SHUTDOWN], False) @classmethod def tearDownClass(self):