Skip to content

Commit

Permalink
Added more debug messages
Browse files Browse the repository at this point in the history
  • Loading branch information
vrbanecd committed Jan 24, 2025
1 parent af697a1 commit 69feed5
Showing 1 changed file with 36 additions and 3 deletions.
39 changes: 36 additions & 3 deletions teapot.py
Original file line number Diff line number Diff line change
Expand Up @@ -472,6 +472,12 @@ async def _stop_webdav_instance(username, state, condition):
state[username] = "STOPPING"
condition.notify()
logger.debug("Stopping storm-webdav server for user %s", username)
logger.debug(
"The state of the storm-webdav server for user %s is %s",
username,
state[username],
)

async with app.state.state_lock:
try:
session = app.state.session_state.pop(username)
Expand Down Expand Up @@ -501,7 +507,11 @@ async def _stop_webdav_instance(username, state, condition):
if state[username] == "STOPPING":
state[username] = "NOT RUNNING"
condition.notify()
condition.release()
logger.debug(
"The state of the storm-webdav server for user %s is %s",
username,
state[username],
)

except subprocess.CalledProcessError as e:
logger.error(
Expand Down Expand Up @@ -727,13 +737,21 @@ async def storm_webdav_state(state, condition, user):
user,
)

logger.debug(
"The state of the storm-webdav server for user %s is %s", user, state[user]
)

while not (state[user] == "STARTING" or state[user] == "RUNNING"):
if state[user] == "NOT_RUNNING":
state[user] = "STARTING"
condition.notify()
should_start_sw = True
logger.debug("Storm-webdav instance for user %s is starting", user)

logger.debug(
"The state of the storm-webdav server for user %s is %s",
user,
state[user],
)
elif state[user] == "RUNNING":
async with app.state.state_lock:
app.state.session_state[user]["last_accessed"] = str(
Expand All @@ -743,7 +761,11 @@ async def storm_webdav_state(state, condition, user):
logger.debug(
"Storm webdav instance for user %s is already running", user
)

logger.debug(
"The state of the storm-webdav server for user %s is %s",
user,
state[user],
)
else:
await condition.wait()

Expand All @@ -767,6 +789,11 @@ async def storm_webdav_state(state, condition, user):
"Something went wrong while starting instance for user %s.",
user,
)
logger.debug(
"The state of the storm-webdav server for user %s is %s",
user,
state[user],
)
return -1

async with condition:
Expand All @@ -785,6 +812,12 @@ async def storm_webdav_state(state, condition, user):
user,
port,
)
logger.debug(
"The state of the storm-webdav server for user %s is %s",
user,
state[user],
)

return port

else:
Expand Down

1 comment on commit 69feed5

@vrbanecd
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Robot Results

✅ Passed ❌ Failed ⏭️ Skipped Total Pass % ⏱️ Duration
32 0 0 32 100 53.522534s

Passed Tests

Name ⏱️ Duration Suite
GET USER1 9.749 s Teapot-Tests
GET USER2 9.561 s Teapot-Tests
GET NO TOKEN 0.012 s Teapot-Tests
GET INVALID TOKEN 0.034 s Teapot-Tests
PUT REQUEST INVALID TOKEN 0.010 s Teapot-Tests
PUT REQUEST NO TOKEN 0.010 s Teapot-Tests
PUT REQUEST USER1 2.190 s Teapot-Tests
PUT REQUEST USER2 2.179 s Teapot-Tests
GET FILE USER1 3.188 s Teapot-Tests
GET FILE USER2 3.209 s Teapot-Tests
GET FILE NO TOKEN 0.009 s Teapot-Tests
GET FILE INVALID TOKEN 0.009 s Teapot-Tests
DELETE REQUEST USER1 2.112 s Teapot-Tests
DELETE REQUEST USER2 2.137 s Teapot-Tests
DELETE REQUEST INVALID TOKEN 0.009 s Teapot-Tests
DELETE REQUEST NO TOKEN 0.009 s Teapot-Tests
GET USER1 EXTRA_AREA 2.109 s Teapot-Tests
GET USER2 EXTRA_AREA 2.111 s Teapot-Tests
GET NO TOKEN EXTRA_AREA 0.010 s Teapot-Tests
GET INVALID TOKEN EXTRA_AREA 0.009 s Teapot-Tests
PUT REQUEST INVALID TOKEN EXTRA_AREA 0.009 s Teapot-Tests
PUT REQUEST NO TOKEN EXTRA_AREA 0.008 s Teapot-Tests
PUT REQUEST USER1 EXTRA_AREA 2.121 s Teapot-Tests
PUT REQUEST USER2 EXTRA_AREA 2.136 s Teapot-Tests
GET FILE USER1 EXTRA_AREA 3.164 s Teapot-Tests
GET FILE USER2 EXTRA_AREA 3.180 s Teapot-Tests
GET FILE NO TOKEN EXTRA_AREA 0.010 s Teapot-Tests
GET FILE INVALID TOKEN EXTRA_AREA 0.009 s Teapot-Tests
DELETE REQUEST USER1 EXTRA_AREA 2.100 s Teapot-Tests
DELETE REQUEST USER2 EXTRA_AREA 2.102 s Teapot-Tests
DELETE REQUEST INVALID TOKEN EXTRA_AREA 0.010 s Teapot-Tests
DELETE REQUEST NO TOKEN EXTRA_AREA 0.009 s Teapot-Tests

Please sign in to comment.