Skip to content

Potential thread leak caused by has_git? method #12

Description

@jakesen

We found that when used in a Sidekiq production environment, shiphawk requests would spawn new threads each time which was executed by this line of code:

IO.popen(['which', 'git']).read.chomp.length > 0

The following output from top gave us the clue that helped find the source of the problem within the shiphawk gem:

image

This resulted in the Sidekiq worker eventually hitting the thread limit and hanging indefinitely.

Adding the APP_VERSION variable to our environment with an arbitrary value bypassed the offending code and resolved the issue for us in our production environment.

I would be happy to work on a patch for this issue so that the shiphawk gem will be safe to use in environments that do not have APP_VERSION variable declared.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions