Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
V
vidai
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
SexHackMe
vidai
Commits
839f119c
Commit
839f119c
authored
Oct 09, 2025
by
Stefy Lanza (nextime / spora )
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add ping forwarding from backend to cluster_master to reset job timeouts
parent
3425ca22
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
0 deletions
+15
-0
backend.py
vidai/backend.py
+10
-0
cluster_master.py
vidai/cluster_master.py
+5
-0
No files found.
vidai/backend.py
View file @
839f119c
...
...
@@ -197,6 +197,16 @@ def handle_worker_message(message: Message, client_sock) -> None:
# Update progress timestamp to reset timeout
job_progress_times
[
job_id
]
=
time
.
time
()
print
(
f
"PING received for job {job_id} - resetting timeout"
)
# Notify cluster master of ping to reset job timeout
try
:
import
socket
notification_sock
=
socket
.
socket
(
socket
.
AF_INET
,
socket
.
SOCK_STREAM
)
notification_sock
.
connect
((
'localhost'
,
5004
))
# Cluster master port + 1
notification_sock
.
sendall
(
f
"ping:{job_id}"
.
encode
())
notification_sock
.
close
()
print
(
f
"Notified cluster master of ping for job {job_id}"
)
except
Exception
as
e
:
print
(
f
"Failed to notify cluster master of ping: {e}"
)
elif
message
.
msg_type
in
[
'analyze_response'
,
'train_response'
]:
# Store result for web to poll
pending_results
[
message
.
msg_id
]
=
message
...
...
vidai/cluster_master.py
View file @
839f119c
...
...
@@ -242,6 +242,11 @@ class ClusterMaster:
print
(
"Received worker registration notification - checking for pending jobs"
)
# Trigger immediate job assignment check
await
self
.
_check_pending_jobs
()
elif
message
.
startswith
(
"ping:"
):
job_id
=
message
.
split
(
":"
,
1
)[
1
]
if
job_id
in
self
.
active_jobs
:
self
.
active_jobs
[
job_id
][
'last_progress'
]
=
time
.
time
()
print
(
f
"Ping received for job {job_id} - resetting timeout"
)
except
Exception
as
e
:
print
(
f
"Notification handling error: {e}"
)
finally
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment