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

Log Unhandled rejection stack #113614

Merged
merged 7 commits into from
Oct 11, 2021
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Refactor state types
rudolf committed Sep 28, 2021
commit 6a5123a1b2d2b40089c94109619c471b3c33acf2
Original file line number Diff line number Diff line change
@@ -6,7 +6,7 @@
* Side Public License, v 1.
*/
import * as TaskEither from 'fp-ts/lib/TaskEither';
import type { TransformRawDocs } from '../types';
import type { TransformRawDocs } from '../state';
import type { SavedObjectsRawDoc } from '../../serialization';
import {
DocumentsTransformFailed,
2 changes: 1 addition & 1 deletion src/core/server/saved_objects/migrationsv2/index.ts
Original file line number Diff line number Diff line change
@@ -10,7 +10,7 @@ import { ElasticsearchClient } from '../../elasticsearch';
import { IndexMapping } from '../mappings';
import { Logger } from '../../logging';
import type { SavedObjectsMigrationVersion } from '../types';
import type { TransformRawDocs } from './types';
import type { TransformRawDocs } from './state';
import { MigrationResult } from '../migrations/core';
import { next } from './next';
import { model } from './model';
Original file line number Diff line number Diff line change
@@ -11,7 +11,7 @@ import { IndexMapping } from '../mappings';
import { SavedObjectsMigrationVersion } from '../../../types';
import { SavedObjectsMigrationConfigType } from '../saved_objects_config';
import type { ISavedObjectTypeRegistry } from '../saved_objects_type_registry';
import { InitState } from './types';
import { InitState } from './state';
import { excludeUnusedTypesQuery } from '../migrations/core';

/**
Original file line number Diff line number Diff line change
@@ -15,7 +15,7 @@ import * as Option from 'fp-ts/lib/Option';
import { ResponseError } from '@elastic/elasticsearch/lib/errors';
import { elasticsearchClientMock } from '../../elasticsearch/client/mocks';
import { LoggerAdapter } from '../../logging/logger_adapter';
import { AllControlStates, State } from './types';
import { AllControlStates, State } from './state';
import { createInitialState } from './initial_state';
import { ByteSizeValue } from '@kbn/config-schema';

Original file line number Diff line number Diff line change
@@ -13,7 +13,7 @@ import type { ElasticsearchClient } from '../../elasticsearch';
import { getErrorMessage, getRequestDebugMeta } from '../../elasticsearch';
import { Model, Next, stateActionMachine } from './state_action_machine';
import { cleanup } from './migrations_state_machine_cleanup';
import { ReindexSourceToTempTransform, ReindexSourceToTempIndexBulk, State } from './types';
import { ReindexSourceToTempTransform, ReindexSourceToTempIndexBulk, State } from './state';
import { SavedObjectsRawDoc } from '../serialization';

interface StateTransitionLogMeta extends LogMeta {
Original file line number Diff line number Diff line change
@@ -8,7 +8,7 @@

import type { ElasticsearchClient } from '../../elasticsearch';
import * as Actions from './actions';
import type { State } from './types';
import type { State } from './state';

export async function cleanup(client: ElasticsearchClient, state?: State) {
if (!state) return;
Original file line number Diff line number Diff line change
@@ -7,7 +7,7 @@
*/

import { gt, valid } from 'semver';
import { State } from '../types';
import { State } from '../state';
import { IndexMapping } from '../../mappings';
import { FetchIndexResponse } from '../actions';

Original file line number Diff line number Diff line change
@@ -40,7 +40,7 @@ import type {
ReindexSourceToTempIndexBulk,
CheckUnknownDocumentsState,
CalculateExcludeFiltersState,
} from '../types';
} from '../state';
import { SavedObjectsRawDoc } from '../../serialization';
import { TransformErrorObjects, TransformSavedObjectDocumentError } from '../../migrations/core';
import { AliasAction, RetryableEsClientError } from '../actions';
2 changes: 1 addition & 1 deletion src/core/server/saved_objects/migrationsv2/model/model.ts
Original file line number Diff line number Diff line change
@@ -11,7 +11,7 @@ import * as Option from 'fp-ts/lib/Option';

import { estypes } from '@elastic/elasticsearch';
import { AliasAction, isLeftTypeof } from '../actions';
import { AllActionStates, MigrationLog, State } from '../types';
import { AllActionStates, MigrationLog, State } from '../state';
import type { ResponseType } from '../next';
import { disableUnknownTypeMappingFields } from '../../migrations/core/migration_context';
import {
Original file line number Diff line number Diff line change
@@ -6,7 +6,7 @@
* Side Public License, v 1.
*/

import type { MigrationLog } from '../types';
import type { MigrationLog } from '../state';
import {
createInitialProgress,
incrementProcessedProgress,
Original file line number Diff line number Diff line change
@@ -6,7 +6,7 @@
* Side Public License, v 1.
*/

import type { MigrationLog, Progress } from '../types';
import type { MigrationLog, Progress } from '../state';

/**
* Returns an initial state of the progress object (everything undefined)
Original file line number Diff line number Diff line change
@@ -7,7 +7,7 @@
*/

import { resetRetryState, delayRetryState } from './retry_state';
import { State } from '../types';
import { State } from '../state';

const createState = (parts: Record<string, any>) => {
return parts as State;
Original file line number Diff line number Diff line change
@@ -6,7 +6,7 @@
* Side Public License, v 1.
*/

import { State } from '../types';
import { State } from '../state';

export const delayRetryState = <S extends State>(
state: S,
2 changes: 1 addition & 1 deletion src/core/server/saved_objects/migrationsv2/next.test.ts
Original file line number Diff line number Diff line change
@@ -8,7 +8,7 @@

import { ElasticsearchClient } from '../../elasticsearch';
import { next } from './next';
import { State } from './types';
import { State } from './state';

describe('migrations v2 next', () => {
it.todo('when state.retryDelay > 0 delays execution of the next action');
2 changes: 1 addition & 1 deletion src/core/server/saved_objects/migrationsv2/next.ts
Original file line number Diff line number Diff line change
@@ -41,7 +41,7 @@ import type {
OutdatedDocumentsRefresh,
CheckUnknownDocumentsState,
CalculateExcludeFiltersState,
} from './types';
} from './state';
import * as Actions from './actions';
import { ElasticsearchClient } from '../../elasticsearch';