-
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
DB workflow_params
table: store None
instead of deleting/not storing params
#5618
Conversation
d8de966
to
d9ab35a
Compare
cylc/flow/rundb.py
Outdated
@@ -545,22 +545,18 @@ def select_broadcast_states(self, callback, sort=None): | |||
for row_idx, row in enumerate(self.connect().execute(stmt)): | |||
callback(row_idx, list(row)) | |||
|
|||
def select_workflow_params(self, callback): | |||
"""Select from workflow_params. | |||
def select_workflow_params(self) -> Iterable[Tuple[str, str]]: |
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.
👍
if self.options.holdcp is None: | ||
elif key == self.workflow_db_mgr.KEY_UUID_STR: | ||
self.uuid_str = value | ||
LOG.info(f"+ workflow UUID = {value}") |
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.
FYI, this is a negative change.
The way it was before, the string formatting only happened if the message was actually logged. With this change the string formatting happens, even if the message is not needed.
This is why the variables are provided as arguments to the logging function rather than '+ workflow UUID = %s' % value
.
% formatting is still the documented advice.
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.
Interesting to know 👍 However this method is only called once per restart and reload so I don't think it is significant in this case. Also most of these are INFO level so will be logged in the vast majority of cases
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.
I'm not asking for changes, but please leave these out of future tidying (there's no gain to converting them). Profiling is showing logging to be a surprisingly large CPU sink.
For a more modern syntax I think positional {}
formatting should work the same e.g:
LOG.debug('{0} something', itask)
Prevents problems caused by rapidly toggled params before processing DB queue
d9ab35a
to
8ab9f7f
Compare
Ah, note if you try to restart a workflow ran with this version of Cylc in an earlier version, you're going to get
plus traceback. This is unavoidable |
This is ok for a minor release. We aim to keep the DB forward compatible (with upgraders) within reason, but backward compatibility is not a concern, |
Closes #5593
So instead of deleting or not storing params, store them as
None
(which is an empty string for theTEXT
type in sqlite). In the case ofis_paused
store it as a boolean ('0'
or'1'
).Full compatibility with pre-8.2.0 workflow databases is maintained. However, 8.2.0 workflow databases will not be compatible with earlier versions of Cylc.
Check List
CONTRIBUTING.md
and added my name as a Code Contributor.CHANGES.md
entry included if this is a change that can affect users