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

[BUG] [@osd/opensearch] Calling stop on an already ended Cluster producess different results on different platforms #2811

Open
AMoo-Miki opened this issue Nov 6, 2022 · 2 comments
Labels
bug Something isn't working help wanted Community development is encouraged

Comments

@AMoo-Miki
Copy link
Collaborator

AMoo-Miki commented Nov 6, 2022

Describe the bug

OSD uses tree-kill [npm], a library that terminates a process and all of its children, for stopping processes started using Cluster. This library behaves differently on different platforms. If the pid it is asked to terminate is not running:

  • on darwin and linux, it silently returns without throwing and exception
  • on win32 in produces an exception

As a result, calling cluster.stop() on an already terminated cluster will throw and exception on Windows but will silently continue on other operating systems.

async stop() {
if (this._stopCalled) {
return;
}
this._stopCalled = true;
if (!this._process || !this._outcome) {
throw new Error('OpenSearch has not been started');
}
await treeKillAsync(this._process.pid);
await this._outcome;
}

This library is also used by ProcessRunnder of @osd/dev-utils and impacts its ability to successfully terminate the processes it starts.

Expected behavior
No exception thrown

Dashboards Version
main

@AMoo-Miki AMoo-Miki added bug Something isn't working untriaged labels Nov 6, 2022
@seanneumann
Copy link
Contributor

Triage - @AMoo-Miki to apply a fix to mitigate it, but we should also follow-up with a longer term solution.

AMoo-Miki added a commit to AMoo-Miki/OpenSearch-Dashboards that referenced this issue Nov 9, 2022
…sed a `pid` for a process that is already dead

Ref: opensearch-project#2811

Signed-off-by: Miki <amoo_miki@yahoo.com>
AMoo-Miki added a commit to AMoo-Miki/OpenSearch-Dashboards that referenced this issue Nov 9, 2022
…sed a `pid` for a process that is already dead

Ref: opensearch-project#2811

Signed-off-by: Miki <amoo_miki@yahoo.com>
ananzh pushed a commit that referenced this issue Nov 9, 2022
…sed a `pid` for a process that is already dead (#2842)

Ref: #2811

Signed-off-by: Miki <amoo_miki@yahoo.com>

Signed-off-by: Miki <amoo_miki@yahoo.com>
opensearch-trigger-bot bot pushed a commit that referenced this issue Nov 9, 2022
…sed a `pid` for a process that is already dead (#2842)

Ref: #2811

Signed-off-by: Miki <amoo_miki@yahoo.com>

Signed-off-by: Miki <amoo_miki@yahoo.com>
(cherry picked from commit 4fd67de)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

# Conflicts:
#	CHANGELOG.md
opensearch-trigger-bot bot pushed a commit that referenced this issue Nov 9, 2022
…sed a `pid` for a process that is already dead (#2842)

Ref: #2811

Signed-off-by: Miki <amoo_miki@yahoo.com>

Signed-off-by: Miki <amoo_miki@yahoo.com>
(cherry picked from commit 4fd67de)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

# Conflicts:
#	CHANGELOG.md
ananzh pushed a commit that referenced this issue Nov 9, 2022
…sed a `pid` for a process that is already dead (#2842) (#2845)

Ref: #2811

Signed-off-by: Miki <amoo_miki@yahoo.com>

Signed-off-by: Miki <amoo_miki@yahoo.com>
(cherry picked from commit 4fd67de)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

# Conflicts:
#	CHANGELOG.md

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
ananzh pushed a commit that referenced this issue Nov 9, 2022
…sed a `pid` for a process that is already dead (#2842) (#2844)

Ref: #2811

Signed-off-by: Miki <amoo_miki@yahoo.com>

Signed-off-by: Miki <amoo_miki@yahoo.com>
(cherry picked from commit 4fd67de)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

# Conflicts:
#	CHANGELOG.md

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
opensearch-trigger-bot bot pushed a commit that referenced this issue Nov 30, 2022
…sed a `pid` for a process that is already dead (#2842)

Ref: #2811

Signed-off-by: Miki <amoo_miki@yahoo.com>

Signed-off-by: Miki <amoo_miki@yahoo.com>
(cherry picked from commit 4fd67de)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

# Conflicts:
#	CHANGELOG.md
opensearch-trigger-bot bot pushed a commit that referenced this issue Nov 30, 2022
…sed a `pid` for a process that is already dead (#2842)

Ref: #2811

Signed-off-by: Miki <amoo_miki@yahoo.com>

Signed-off-by: Miki <amoo_miki@yahoo.com>
(cherry picked from commit 4fd67de)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

# Conflicts:
#	CHANGELOG.md
ananzh pushed a commit that referenced this issue Dec 1, 2022
…sed a `pid` for a process that is already dead (#2842) (#2969)

Ref: #2811

Signed-off-by: Miki <amoo_miki@yahoo.com>

Signed-off-by: Miki <amoo_miki@yahoo.com>
(cherry picked from commit 4fd67de)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

# Conflicts:
#	CHANGELOG.md

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
AMoo-Miki pushed a commit that referenced this issue Dec 1, 2022
…sed a `pid` for a process that is already dead (#2842) (#2970)

Ref: #2811

Signed-off-by: Miki <amoo_miki@yahoo.com>

Signed-off-by: Miki <amoo_miki@yahoo.com>
(cherry picked from commit 4fd67de)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

# Conflicts:
#	CHANGELOG.md

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
@AMoo-Miki
Copy link
Collaborator Author

The temporary workaround is in. However, the library has several issues about its inability to kill a process; a replacement needs to be found/created.

@AMoo-Miki AMoo-Miki removed their assignment Dec 8, 2022
@joshuarrrr joshuarrrr added the help wanted Community development is encouraged label Dec 8, 2022
AlexRuiz7 pushed a commit to wazuh/wazuh-dashboard that referenced this issue Dec 14, 2022
…sed a `pid` for a process that is already dead (opensearch-project#2842)

Ref: opensearch-project#2811

Signed-off-by: Miki <amoo_miki@yahoo.com>

Signed-off-by: Miki <amoo_miki@yahoo.com>
AlexRuiz7 pushed a commit to wazuh/wazuh-dashboard that referenced this issue Dec 14, 2022
…sed a `pid` for a process that is already dead (opensearch-project#2842)

Ref: opensearch-project#2811

Signed-off-by: Miki <amoo_miki@yahoo.com>

Signed-off-by: Miki <amoo_miki@yahoo.com>
sipopo pushed a commit to sipopo/OpenSearch-Dashboards that referenced this issue Dec 16, 2022
…sed a `pid` for a process that is already dead (opensearch-project#2842)

Ref: opensearch-project#2811

Signed-off-by: Miki <amoo_miki@yahoo.com>

Signed-off-by: Miki <amoo_miki@yahoo.com>
Signed-off-by: Sergey Osipov <sipopo@yandex.ru>
Arpit-Bandejiya pushed a commit to Arpit-Bandejiya/OpenSearch-Dashboards that referenced this issue Jan 13, 2023
…sed a `pid` for a process that is already dead (opensearch-project#2842)

Ref: opensearch-project#2811

Signed-off-by: Miki <amoo_miki@yahoo.com>

Signed-off-by: Miki <amoo_miki@yahoo.com>
Signed-off-by: Arpit Bandejiya <abandeji@amazon.com>
sikhote pushed a commit to sikhote/OpenSearch-Dashboards that referenced this issue Apr 24, 2023
…sed a `pid` for a process that is already dead (opensearch-project#2842)

Ref: opensearch-project#2811

Signed-off-by: Miki <amoo_miki@yahoo.com>

Signed-off-by: Miki <amoo_miki@yahoo.com>
Signed-off-by: David Sinclair <david@sinclair.tech>
sikhote pushed a commit to sikhote/OpenSearch-Dashboards that referenced this issue Apr 24, 2023
…sed a `pid` for a process that is already dead (opensearch-project#2842)

Ref: opensearch-project#2811

Signed-off-by: Miki <amoo_miki@yahoo.com>

Signed-off-by: Miki <amoo_miki@yahoo.com>
Signed-off-by: David Sinclair <david@sinclair.tech>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Community development is encouraged
Projects
None yet
Development

No branches or pull requests

3 participants