Skip to content

LSFPlugin sets ignore_exception=True on line 57 of lsf.py plugin causing workflow to crash due to deprecation #2508

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

Closed
mattfeld opened this issue Mar 23, 2018 · 4 comments
Milestone

Comments

@mattfeld
Copy link
Contributor

The _is_pending function in the LSFPlugin when running the command sets the ignore_exception=True on line 57. See below:

def _is_pending(self, taskid):
        """LSF lists a status of 'PEND' when a job has been submitted but is
        waiting to be picked up, and 'RUN' when it is actively being processed.
        But _is_pending should return True until a job has finished and is
        ready to be checked for completeness. So return True if status is
        either 'PEND' or 'RUN'"""
        cmd = CommandLine(
            'bjobs', resource_monitor=False, terminal_output='allatonce')
        cmd.inputs.args = '%d' % taskid
        # check lsf task
        oldlevel = iflogger.level
        iflogger.setLevel(logging.getLevelName('CRITICAL'))
        result = cmd.run(ignore_exception=True)
        iflogger.setLevel(oldlevel)
        # logger.debug(result.runtime.stdout)
        if 'DONE' in result.runtime.stdout or 'EXIT' in result.runtime.stdout:
            return False
        else:
            return True

This results in workflows not executing with newer versions of nipype (I'm using version 1.0.1) exiting with the following error:

TraitError: Input ignore_exception in interface CommandLine is deprecated. Will be removed or raise an error as of release 1.0.0

I removed ignore_exception=True from my copy of nipype and was able to execute the workflow with no problems.

@mgxd
Copy link
Member

mgxd commented Mar 23, 2018

@mattfeld you could add it into the cmd as well

cmd = CommandLine(
            'bjobs', resource_monitor=False, terminal_output='allatonce', ignore_exception=True)

Would you like to submit a PR for this fix?

@mattfeld
Copy link
Contributor Author

@mgxd I'd be happy to submit a PR for this fix. Do you think it would be more appropriate to add it into the cmd or remove it out right result = cmd.run()?

@mgxd
Copy link
Member

mgxd commented Mar 23, 2018

I'd suggest adding it to the command to retain the previous behavior

@djarecka
Copy link
Collaborator

@mattfeld - could you please check if you're having problems with the current version. My PR hopefully solved also this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants