Skip to content

add some debug logs #55

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
8 changes: 5 additions & 3 deletions runbot/runbot.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ def uniq_list(l):
return OrderedDict.fromkeys(l).keys()

def fqdn():
return socket.gethostname()
return socket.getfqdn()

#----------------------------------------------------------
# RunBot Models
Expand Down Expand Up @@ -315,7 +315,7 @@ def scheduler(self, cr, uid, ids=None, context=None):
workers = int(icp.get_param(cr, uid, 'runbot.workers', default=6))
running_max = int(icp.get_param(cr, uid, 'runbot.running_max', default=75))
host = fqdn()

_logger.debug('in scheduler %s', ids)
Build = self.pool['runbot.build']
domain = [('repo_id', 'in', ids)]
domain_host = domain + [('host', '=', host)]
Expand All @@ -327,8 +327,8 @@ def scheduler(self, cr, uid, ids=None, context=None):
# launch new tests
testing = Build.search_count(cr, uid, domain_host + [('state', '=', 'testing')])
pending = Build.search_count(cr, uid, domain + [('state', '=', 'pending')])

while testing < workers and pending > 0:
_logger.debug('scheduler: testing: %d, workers: %d, pending: %d', testing, workers, pending)

# find sticky pending build if any, otherwise, last pending (by id, not by sequence) will do the job
pending_ids = Build.search(cr, uid, domain + [('state', '=', 'pending'), ('branch_id.sticky', '=', True)], limit=1)
Expand All @@ -341,6 +341,7 @@ def scheduler(self, cr, uid, ids=None, context=None):
# compute the number of testing and pending jobs again
testing = Build.search_count(cr, uid, domain_host + [('state', '=', 'testing')])
pending = Build.search_count(cr, uid, domain + [('state', '=', 'pending')])
_logger.debug('scheduler full: testing: %d, workers: %d, pending: %d', testing, workers, pending)

# terminate and reap doomed build
build_ids = Build.search(cr, uid, domain_host + [('state', '=', 'running')])
Expand Down Expand Up @@ -870,6 +871,7 @@ def schedule(self, cr, uid, ids, context=None):
timeout = int(icp.get_param(cr, uid, 'runbot.timeout', default=1800))

for build in self.browse(cr, uid, ids, context=context):
_logger.debug('schedule build %r state %s', build.dest, build.state)
if build.state == 'pending':
# allocate port and schedule first job
port = self.find_port(cr, uid)
Expand Down