-
Notifications
You must be signed in to change notification settings - Fork 94
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
localhost background/at jobs: record host name #2849
localhost background/at jobs: record host name #2849
Conversation
@oliver-sanders @kinow please review or reassign to someone near you. |
+1 |
#2809 will require an associated change to work with this PR, I'm guessing the following would do the job: if (
- itask.task_host == 'localhost' and
+ itask.task_host == get_host() and
- itask.summary['batch_sys_name'] in ['background', 'at'] and
itask.state.status in TASK_STATUSES_ACTIVE
): @matthewrmshin any thoughts? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code looks good, comments ditto. Travis-CI happy 🎉
Tested using master first, and got
kinow@kinow-VirtualBox:~/cylc-run/five/log/suite$ cat log.20181109T004933Z
2018-11-09T00:49:33Z INFO - Suite server: url=https://kinow-VirtualBox:43092/ pid=3126
2018-11-09T00:49:33Z INFO - Run: (re)start=0 log=1
2018-11-09T00:49:33Z INFO - Cylc version: 7.7.1-352-g395e2
2018-11-09T00:49:33Z INFO - Run mode: live
2018-11-09T00:49:33Z INFO - Initial point: 20130808T0000Z
2018-11-09T00:49:33Z INFO - Final point: 20130812T0000Z
2018-11-09T00:49:33Z INFO - Cold Start 20130808T0000Z
2018-11-09T00:49:33Z INFO - [prep.20130808T0000Z] -submit-num=1, owner@host=localhost
Then switched to this pull request's branch, and confirmed that the host had changed.
2018-11-09T00:55:14Z INFO - Suite starting: server=kinow-VirtualBox:43006 pid=5271
2018-11-09T00:55:14Z INFO - Cylc version: 7.7.1-332-g19ad1
2018-11-09T00:55:14Z INFO - Run mode: live
2018-11-09T00:55:14Z INFO - Initial point: 20130808T0000Z
2018-11-09T00:55:14Z INFO - Final point: 20130812T0000Z
2018-11-09T00:55:14Z INFO - Cold Start 20130808T0000Z
2018-11-09T00:55:14Z INFO - [prep.20130808T0000Z] -submit-num=1, owner@host=kinow-VirtualBox
And just to make sure, had a look inside the sqlite database, and confirmed at least the task_jobs
table had the new value too, instead of localhost.
...
sqlite> select * from task_jobs;
20130808T0000Z|prep|1|0|1|2018-11-09T00:55:14Z|2018-11-09T00:55:15Z|0|2018-11-09T00:55:15Z|2018-11-09T00:55:15Z||0|kinow-VirtualBox|background|5328
20130808T0000Z|foo|1|0|1|2018-11-09T00:55:17Z|2018-11-09T00:55:18Z|0|2018-11-09T00:55:18Z|2018-11-09T00:55:18Z||0|kinow-VirtualBox|background|5421
...
Happy to merge, but it got conflicted 😢 |
Ensure that localhost background/at jobs are recorded as running on the host name of the current suite host, rather than just `localhost`. On suite restart on a different suite host, this allows the restart logic to correctly poll the status of the background/at jobs that may still be running on the previous suite host.
19ad1dd
to
4006ff8
Compare
Branch rebased to resolve conflicts. |
Just waiting for Travis-CI to hit the merge button 🎉 |
…cylc-2781 Fix tests broken by cylc/cylc-flow#2781 and cylc/cylc-flow#2849
Ensure that
localhost
background/at jobs are recorded as running on the host name of the current suite host, rather than justlocalhost
. On suite restart on a different suite host, this allows the restart logic to correctly poll the status of the background/at jobs that may still be running on the previous suite host.Perfect companion of #2809.