Skip to content

Add timeout to process codebase and plugin steps#5153

Open
AyanSinhaMahapatra wants to merge 1 commit into
developfrom
add-plugin-timeout
Open

Add timeout to process codebase and plugin steps#5153
AyanSinhaMahapatra wants to merge 1 commit into
developfrom
add-plugin-timeout

Conversation

@AyanSinhaMahapatra

Copy link
Copy Markdown
Member

Reference:

Tasks

  • Reviewed contribution guidelines
  • PR is descriptively titled 📑 and links the original issue above 🔗
  • Tests pass -- look for a green checkbox ✔️ a few minutes after opening your PR
    Run tests locally to check for errors.
  • Commits are in uniquely-named feature branch and has no merge conflicts 📁
  • Updated documentation pages (if applicable)
  • Updated CHANGELOG.rst (if applicable)

Signed-off-by: Ayan Sinha Mahapatra <asmahapatra@aboutcode.org>
@AyanSinhaMahapatra

Copy link
Copy Markdown
Member Author

Need some review there wrt. the default behaviour there, as these timeouts can cause weird issues/crashes elsewhere, so should we just keep this only as a CLI option which can be enabled to set a timeout, or have a default timeout like we have in the file-level scan timeout. If we have this as a default we also have to decide on a reasonable timeout duration.

@pombredanne pombredanne left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! Could we do better and avoid another new option?

Comment thread src/scancode/interrupt.py


DEFAULT_TIMEOUT = 120 # seconds
DEFAULT_PLUGIN_TIMEOUT = 2400 # seconds

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is way too much? 40 minutes feels forever. And why 40 minutes?

Comment thread src/scancode/cli.py
f'[default: {DEFAULT_TIMEOUT} seconds]',
help_group=cliutils.CORE_GROUP, sort_order=10, cls=PluggableCommandLineOption)

@click.option('--timeout-plugins',

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I find that new option confusing... and the default of 2400s super long

Comment thread src/scancode/cli.py

# TODO: add progress indicator
# run the process codebase of each scan plugin (most often a no-op)
use_threading = processes >= 0

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you sure you want that? It seems not used at all

Comment thread src/scancode/cli.py
type=float,
default=DEFAULT_PLUGIN_TIMEOUT,
metavar='<seconds>',
help='Stop an unfinished codebase processing or post-scan plugin after'

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I cannot put my head around this... could we not use a simpler single timeout across the board instead?

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants