From 59ab7f91c53f3d87f27dc015055be4927df0fb2d Mon Sep 17 00:00:00 2001 From: Emir Muhammad Date: Mon, 27 Apr 2026 18:19:21 +0200 Subject: [PATCH 1/3] rename partition into session with caveats --- src/drunc/apps/fake_daqapp_rest.py | 6 ++++-- src/drunc/connectivity_service/client.py | 12 ++++++------ src/drunc/controller/interface/controller.py | 2 +- src/drunc/unified_shell/shell.py | 2 +- 4 files changed, 12 insertions(+), 10 deletions(-) diff --git a/src/drunc/apps/fake_daqapp_rest.py b/src/drunc/apps/fake_daqapp_rest.py index 846d07010..31b977a46 100644 --- a/src/drunc/apps/fake_daqapp_rest.py +++ b/src/drunc/apps/fake_daqapp_rest.py @@ -224,12 +224,14 @@ def main(): ) parser.add_argument( "-p", - "--partition", + "--partition", #! will likely need to change default="global", help="This is a dummy argument in this case", ) parser.add_argument("-s", "--session", default="test", help="name of session") - parser.add_argument("-k", "--configurationID", default="test-config", help="ID of session") + parser.add_argument( + "-k", "--configurationID", default="test-config", help="ID of session" + ) args = parser.parse_args() diff --git a/src/drunc/connectivity_service/client.py b/src/drunc/connectivity_service/client.py index 87361690b..b6df2c0b8 100644 --- a/src/drunc/connectivity_service/client.py +++ b/src/drunc/connectivity_service/client.py @@ -72,7 +72,7 @@ def is_ready(self, timeout: int = 10): def retract(self, uid, fail_quickly=False): data = { - "partition": self.session, + "partition": self.session, #! will likely need to change "connections": [ { "connection_id": uid, @@ -120,11 +120,11 @@ def retract(self, uid, fail_quickly=False): if fail_quickly: return - def retract_partition( + def retract_session( self, fail_quickly: bool = False, fail_quietly: bool = False ) -> None: """ - Retract the whole partition (session) from the connectivity service. + Retract the whole session from the connectivity service. Args: fail_quickly (bool): If True, the function will return immediately on failure without @@ -132,7 +132,7 @@ def retract_partition( fail_quietly (bool): If True, the function will suppress all exceptions and log errors as warnings. Default is False. """ - data = {"partition": self.session} + data = {"partition": self.session} #! will likely need to change for i in range(50): try: self.log.debug( @@ -140,7 +140,7 @@ def retract_partition( ) r = http_post( - self.address + "/retract-partition", + self.address + "/retract-session", data=data, headers={"Content-Type": "application/json"}, as_json=True, @@ -222,7 +222,7 @@ def publish(self, uid, uri, data_type: str): http_post( self.address + "/publish", data={ - "partition": self.session, + "partition": self.session, #! will likely need to change "connections": [ { "connection_type": 0, diff --git a/src/drunc/controller/interface/controller.py b/src/drunc/controller/interface/controller.py index 4eadef8a2..bb67ce28d 100644 --- a/src/drunc/controller/interface/controller.py +++ b/src/drunc/controller/interface/controller.py @@ -131,7 +131,7 @@ def kill_me(sig, frame): log_km = get_logger("controller.iface.kill_me") log_km.info("Sending SIGKILL") if ctrlr.top_segment_controller: - ctrlr.connectivity_service.retract_partition(fail_quickly=True) + ctrlr.connectivity_service.retract_session(fail_quickly=True) pgrp = os.getpgid(os.getpid()) os.killpg(pgrp, signal.SIGKILL) diff --git a/src/drunc/unified_shell/shell.py b/src/drunc/unified_shell/shell.py index a3dfd1678..90d898963 100644 --- a/src/drunc/unified_shell/shell.py +++ b/src/drunc/unified_shell/shell.py @@ -488,7 +488,7 @@ def cleanup(): ctx.obj.session_name, connectivity_service_address ) try: - csc.retract_partition(fail_quickly=True, fail_quietly=True) + csc.retract_session(fail_quickly=True, fail_quietly=True) unified_shell_log.debug( "Session retracted from the connectivity service" ) From 7639128fc3029f3f800220166e066afd684d34b9 Mon Sep 17 00:00:00 2001 From: Emir Muhammad Date: Tue, 28 Apr 2026 12:45:20 +0200 Subject: [PATCH 2/3] renamed payload partition to session --- src/drunc/connectivity_service/client.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/drunc/connectivity_service/client.py b/src/drunc/connectivity_service/client.py index b6df2c0b8..1140e1230 100644 --- a/src/drunc/connectivity_service/client.py +++ b/src/drunc/connectivity_service/client.py @@ -72,7 +72,7 @@ def is_ready(self, timeout: int = 10): def retract(self, uid, fail_quickly=False): data = { - "partition": self.session, #! will likely need to change + "session": self.session, #! will likely need to change "connections": [ { "connection_id": uid, @@ -132,7 +132,7 @@ def retract_session( fail_quietly (bool): If True, the function will suppress all exceptions and log errors as warnings. Default is False. """ - data = {"partition": self.session} #! will likely need to change + data = {"session": self.session} #! will likely need to change for i in range(50): try: self.log.debug( @@ -222,7 +222,7 @@ def publish(self, uid, uri, data_type: str): http_post( self.address + "/publish", data={ - "partition": self.session, #! will likely need to change + "session": self.session, #! will likely need to change "connections": [ { "connection_type": 0, From b37b7e55328002498c449f7e377df3e883046ef3 Mon Sep 17 00:00:00 2001 From: Emir Muhammad Date: Tue, 28 Apr 2026 12:53:53 +0200 Subject: [PATCH 3/3] Decide to keep partition in fakedaqapp(?) --- src/drunc/apps/fake_daqapp_rest.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/drunc/apps/fake_daqapp_rest.py b/src/drunc/apps/fake_daqapp_rest.py index 31b977a46..cc403c95a 100644 --- a/src/drunc/apps/fake_daqapp_rest.py +++ b/src/drunc/apps/fake_daqapp_rest.py @@ -224,7 +224,7 @@ def main(): ) parser.add_argument( "-p", - "--partition", #! will likely need to change + "--partition", default="global", help="This is a dummy argument in this case", )