Skip to content

Commit

Permalink
Merge branch 'main' into release-runbook
Browse files Browse the repository at this point in the history
  • Loading branch information
noCharger authored Nov 10, 2022
2 parents 5f161b6 + 4fd67de commit ff65003
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 5 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
- Removes Add Integration button ([#2723](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/2723))
- Change geckodriver version to make consistency ([#2772](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/2772))
- [Multi DataSource] Update default audit log path ([#2793](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/2793))
- [Table Visualization] Fix first column sort issue ([#2828](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/2828))
- Temporary workaround for task-kill exceptions on Windows when it is passed a pid for a process that is already dead ([#2842](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/2842))

### 🚞 Infrastructure

Expand Down
17 changes: 16 additions & 1 deletion packages/osd-opensearch/src/cluster.js
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,22 @@ exports.Cluster = class Cluster {
throw new Error('OpenSearch has not been started');
}

await treeKillAsync(this._process.pid);
/* Temporary fix for https://github.com/opensearch-project/OpenSearch-Dashboards/issues/2811
*
* `tree-kill` behaves differently on Windows, where it throws if `pid` is already dead, when
* compared to other operating systems, where it silently returns.
*/
try {
await treeKillAsync(this._process.pid);
} catch (ex) {
console.log('ex.message', ex.message);
if (
process.platform === 'win32' &&
!ex.message?.includes(`The process "${this._process.pid}" not found`)
) {
throw ex;
}
}

await this._outcome;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,10 @@ export const TableVisComponent = ({
const pagination = usePagination(visConfig, rows.length);

const sortedRows = useMemo(() => {
return uiState.sort?.colIndex && uiState.sort.direction
? orderBy(rows, columns[uiState.sort.colIndex]?.id, uiState.sort.direction)
return uiState.sort.colIndex !== null &&
columns[uiState.sort.colIndex].id &&
uiState.sort.direction
? orderBy(rows, columns[uiState.sort.colIndex].id, uiState.sort.direction)
: rows;
}, [columns, rows, uiState]);

Expand All @@ -58,8 +60,10 @@ export const TableVisComponent = ({
const dataGridColumns = getDataGridColumns(sortedRows, columns, table, event, uiState.width);

const sortedColumns = useMemo(() => {
return uiState.sort?.colIndex && uiState.sort.direction
? [{ id: dataGridColumns[uiState.sort.colIndex]?.id, direction: uiState.sort.direction }]
return uiState.sort.colIndex !== null &&
dataGridColumns[uiState.sort.colIndex].id &&
uiState.sort.direction
? [{ id: dataGridColumns[uiState.sort.colIndex].id, direction: uiState.sort.direction }]
: [];
}, [dataGridColumns, uiState]);

Expand Down

0 comments on commit ff65003

Please sign in to comment.