Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

more logging of build/upload threads, rcq update loop #489

Merged
merged 1 commit into from
Sep 9, 2024
Merged
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
52 changes: 52 additions & 0 deletions dax/dax_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import logging
import traceback
import random
import time

import yaml
import redcap
Expand Down Expand Up @@ -823,6 +824,49 @@ def run(self):
build_errors = self.run_rcq_build(_projects)
run_errors.extend(build_errors)

# While builds and uploads are running, wait, run
# another rcq update and repeat for max iterations.
# Also, each iteration, get updates for build/upload threads.
rcq_count = 0
max_count = 3333
timeout = 1
while rcq_count < max_count:
time.sleep(180)
LOGGER.info(f'rcq update:{rcq_count}')
self.rcq_update()
rcq_count += 1

# Check results
build_done = all([x.ready() for x in build_results])
upload_done = all([x.ready() for x in upload_results])
if build_done and upload_done:
LOGGER.info('all builds and uploads done')
break

# Show current results
LOGGER.info('build threads:')
for i, r in enumerate(build_results):
LOGGER.info(f'{i}:{r.ready()}')
try:
LOGGER.info(f'{i}:result={r.get(timeout=timeout)}')
except:
LOGGER.info(f'{i}:{timeout}')

for p in build_pool._pool:
LOGGER.info(f'pid:{p.pid}:{p.is_alive()}:exit={p.exitcode}')

LOGGER.info('upload threads:')
for i, r in enumerate(upload_results):
LOGGER.info(f'{i}:{r.ready()}')
try:
LOGGER.info(f'{i}:result={r.get(timeout=timeout)}')
except:
LOGGER.info(f'{i}:timeout:{timeout}')

for p in upload_pool._pool:
LOGGER.info(f'pid:{p.pid}:{p.is_alive()}:exit={p.exitcode}')


if self.is_enabled_build() and num_build_threads > 0:
# Wait for builds to finish
LOGGER.info('waiting for builds to finish')
Expand Down Expand Up @@ -859,6 +903,14 @@ def run(self):

return run_errors

def rcq_update(self):
self.rcq.update(
self._rcq,
self._redcap,
build_enabled=False,
launch_enabled=self.is_enabled_launch(),
projects=self.settings_manager.project_names())

def run_build(self, project, settings_file, log_file, lastrun):
build_error = None

Expand Down