Skip to content
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

Improved connection time for broken servers. (#7424) #7429

Merged
merged 1 commit into from
Feb 15, 2022

Conversation

mshingote
Copy link
Contributor

Previously osquery ceasing to respond indefinitely on connection if the server is broken.
Now the ConnectServer call returns in 2 minutes or less to prevent program from ceasing to respond indefinitely.

Previously osquery ceasing to respond indefinitely if the server is broken.
Now the ConnectServer call returns in 2 minutes or less to prevent program from ceasing to respond indefinitely
@mshingote mshingote requested review from a team as code owners December 25, 2021 01:07
@linux-foundation-easycla
Copy link

linux-foundation-easycla bot commented Dec 25, 2021

CLA Signed

The committers are authorized under a signed CLA.

@mshingote
Copy link
Contributor Author

Seems test failure is unrelated to these changes.

This PR has windows WMI connection related changes but failed test case is mac related osquery_tables_system_darwin_tests-test

@mike-myers-tob mike-myers-tob added ready for review Pull requests that are ready to be reviewed by a maintainer Windows labels Jan 4, 2022
@mike-myers-tob
Copy link
Member

Seems test failure is unrelated to these changes.

This PR has windows WMI connection related changes but failed test case is mac related osquery_tables_system_darwin_tests-test

Yes, you can disregard that macOS test for now, we can close and re-open the PR in order to re-run that test.

WBEM_FLAG_CONNECT_USE_MAX_WAIT

So, by changing the lSecurityFlags parameter on the IWbemLocator::ConnectServer call from 0 to WBEM_FLAG_CONNECT_USE_MAX_WAIT, the API call will not be blocked for more than 2 minutes.

I see. MSDN documentation says

A value of zero (0) for this parameter results in the call to ConnectServer returning only after connection to the server is established. This could result in your program ceasing to respond indefinitely if the server is broken.

Seemingly there are no other valid values for this parameter, so it's either "indefinitely" or "two minutes" and the latter does sound better than the former.

@mike-myers-tob
Copy link
Member

@Smjert this looks okay to me but I am not an osquery-committer. Would you agree/approve?

@mshingote
Copy link
Contributor Author

@Smjert @theopolis
Can we merge this?

@directionless directionless added this to the 5.3.0 milestone Feb 1, 2022
@Smjert Smjert merged commit 31c77ca into osquery:master Feb 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
performance ready for review Pull requests that are ready to be reviewed by a maintainer user experience Windows
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants