8000 management: Fix socket fd leak by theopolis · Pull Request #67 · osquery/osquery-python · GitHub
[go: up one dir, main page]

Skip to content

Conversation

@theopolis
Copy link
Member
@theopolis 8000 theopolis commented Aug 6, 2019

It looks like this implementation has always leaked a file descriptor. When it was changed to support Windows it started leaking two descriptors on macOS and Linux.

This fixes the bug by closing the descriptor in the deconstructor.

@theopolis theopolis added the bug label Aug 6, 2019
@theopolis
Copy link
Member Author

This causes the bugs reported in #60.

Copy link
Member
@zwass zwass left a comment

Choose a reason for hiding this comment

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

I am good with this, but I wonder whether we should add an explicit close method to the SpawnInstance object. Cursory research indicates using a "destructor" is sketchy in Python.

Given that we are already relying on this implementation-defined behavior I am okay with moving forward using this as a fix.

@theopolis
Copy link
Member Author

Agree, thus the only expected change people have to make is updating the module version.

Additionally, bump the version to 3.0.6.
@theopolis theopolis merged commit 5f9696f into osquery:master Aug 7, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

0