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

Fix node_exclusive handling in process dispatcher #918

Merged
merged 1 commit into from Apr 10, 2013
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion ion/services/cei/process_dispatcher_service.py
Expand Up @@ -929,7 +929,7 @@ def __init__(self, conf, service):
self.core = ProcessDispatcherCore(self.store, self.registry,
self.eeagent_client, self.notifier)
self.doctor = PDDoctor(self.core, self.store)
self.matchmaker = PDMatchmaker(self.store, self.eeagent_client,
self.matchmaker = PDMatchmaker(self.core, self.store, self.eeagent_client,
self.registry, epum_client, self.notifier, dashi_name,
domain_definition_id, base_domain_config, run_type, restart_throttling_config)

Expand Down
21 changes: 19 additions & 2 deletions ion/services/cei/test/test_process_dispatcher.py
Expand Up @@ -1336,14 +1336,18 @@ def test_code_download(self):

self.waiter.await_state_event(pid, ProcessStateEnum.RUNNING)

def _add_test_process(self, restart_mode=None, queueing_mode=None, execution_engine_id=None):
def _add_test_process(self, restart_mode=None, queueing_mode=None, execution_engine_id=None,
node_exclusive=None):
process_schedule = ProcessSchedule()
target = process_schedule.target = ProcessTarget()
if restart_mode is not None:
process_schedule.restart_mode = restart_mode
if queueing_mode is not None:
process_schedule.queueing_mode = queueing_mode
if execution_engine_id is not None:
process_schedule.target = ProcessTarget(execution_engine_id=execution_engine_id)
target.execution_engine_id = execution_engine_id
if node_exclusive is not None:
target.node_exclusive = node_exclusive

pid = self.pd_cli.create_process(self.process_definition_id)

Expand Down Expand Up @@ -1479,6 +1483,14 @@ def test_missing_eeagent(self):
pids.append(pid)
clients[pid] = client

# now add a couple processes with node exclusive tags
# per OOIION-816, this was not correctly handled.
for i in range(2):
pid, client = self._add_test_process(ProcessRestartMode.ALWAYS,
ProcessQueueingMode.ALWAYS, "engine3", node_exclusive="xlc%s" % i)
pids.append(pid)
clients[pid] = client

self.waiter.await_many_state_events(pids, ProcessStateEnum.RUNNING)

for pid in pids:
Expand Down Expand Up @@ -1511,3 +1523,8 @@ def test_missing_eeagent(self):

# wait for restartables to restart
self.waiter.await_many_state_events(pids, ProcessStateEnum.RUNNING)

for pid in pids:
client = clients[pid]
self.assertTrue(client.is_restart())
self.assertEqual(client.count(), 1)