Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/drunc/apps/fake_daqapp_rest.py
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,9 @@ def main():
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()

Expand Down
12 changes: 6 additions & 6 deletions src/drunc/connectivity_service/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ def is_ready(self, timeout: int = 10):

def retract(self, uid, fail_quickly=False):
data = {
"partition": self.session,
"session": self.session, #! will likely need to change
"connections": [
{
"connection_id": uid,
Expand Down Expand Up @@ -120,27 +120,27 @@ 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
raising exceptions. Default is False.
fail_quietly (bool): If True, the function will suppress all exceptions and log
errors as warnings. Default is False.
"""
data = {"partition": self.session}
data = {"session": self.session} #! will likely need to change
for i in range(50):
try:
self.log.debug(
f"Retracting session {self.session} on the connectivity service, attempt {i + 1}: {data=}"
)

r = http_post(
self.address + "/retract-partition",
self.address + "/retract-session",
data=data,
headers={"Content-Type": "application/json"},
as_json=True,
Expand Down Expand Up @@ -222,7 +222,7 @@ def publish(self, uid, uri, data_type: str):
http_post(
self.address + "/publish",
data={
"partition": self.session,
"session": self.session, #! will likely need to change
"connections": [
{
"connection_type": 0,
Expand Down
2 changes: 1 addition & 1 deletion src/drunc/controller/interface/controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
2 changes: 1 addition & 1 deletion src/drunc/unified_shell/shell.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)
Expand Down
Loading