@fluidframework/container-runtime 2.0.0-dev.7.2.0.204906 → 2.0.0-dev.7.2.0.205722

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -5,5 +5,5 @@
5
5
  * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY
6
6
  */
7
7
  export declare const pkgName = "@fluidframework/container-runtime";
8
- export declare const pkgVersion = "2.0.0-dev.7.2.0.204906";
8
+ export declare const pkgVersion = "2.0.0-dev.7.2.0.205722";
9
9
  //# sourceMappingURL=packageVersion.d.ts.map
@@ -5,5 +5,5 @@
5
5
  * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY
6
6
  */
7
7
  export const pkgName = "@fluidframework/container-runtime";
8
- export const pkgVersion = "2.0.0-dev.7.2.0.204906";
8
+ export const pkgVersion = "2.0.0-dev.7.2.0.205722";
9
9
  //# sourceMappingURL=packageVersion.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"packageVersion.js","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,MAAM,CAAC,MAAM,OAAO,GAAG,mCAAmC,CAAC;AAC3D,MAAM,CAAC,MAAM,UAAU,GAAG,wBAAwB,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n *\n * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY\n */\n\nexport const pkgName = \"@fluidframework/container-runtime\";\nexport const pkgVersion = \"2.0.0-dev.7.2.0.204906\";\n"]}
1
+ {"version":3,"file":"packageVersion.js","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,MAAM,CAAC,MAAM,OAAO,GAAG,mCAAmC,CAAC;AAC3D,MAAM,CAAC,MAAM,UAAU,GAAG,wBAAwB,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n *\n * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY\n */\n\nexport const pkgName = \"@fluidframework/container-runtime\";\nexport const pkgVersion = \"2.0.0-dev.7.2.0.205722\";\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fluidframework/container-runtime",
3
- "version": "2.0.0-dev.7.2.0.204906",
3
+ "version": "2.0.0-dev.7.2.0.205722",
4
4
  "description": "Fluid container runtime",
5
5
  "homepage": "https://fluidframework.com",
6
6
  "repository": {
@@ -35,18 +35,18 @@
35
35
  "temp-directory": "nyc/.nyc_output"
36
36
  },
37
37
  "dependencies": {
38
- "@fluid-internal/client-utils": "2.0.0-dev.7.2.0.204906",
39
- "@fluidframework/container-definitions": "2.0.0-dev.7.2.0.204906",
40
- "@fluidframework/container-runtime-definitions": "2.0.0-dev.7.2.0.204906",
41
- "@fluidframework/core-interfaces": "2.0.0-dev.7.2.0.204906",
42
- "@fluidframework/core-utils": "2.0.0-dev.7.2.0.204906",
43
- "@fluidframework/datastore": "2.0.0-dev.7.2.0.204906",
44
- "@fluidframework/driver-definitions": "2.0.0-dev.7.2.0.204906",
45
- "@fluidframework/driver-utils": "2.0.0-dev.7.2.0.204906",
38
+ "@fluid-internal/client-utils": "2.0.0-dev.7.2.0.205722",
39
+ "@fluidframework/container-definitions": "2.0.0-dev.7.2.0.205722",
40
+ "@fluidframework/container-runtime-definitions": "2.0.0-dev.7.2.0.205722",
41
+ "@fluidframework/core-interfaces": "2.0.0-dev.7.2.0.205722",
42
+ "@fluidframework/core-utils": "2.0.0-dev.7.2.0.205722",
43
+ "@fluidframework/datastore": "2.0.0-dev.7.2.0.205722",
44
+ "@fluidframework/driver-definitions": "2.0.0-dev.7.2.0.205722",
45
+ "@fluidframework/driver-utils": "2.0.0-dev.7.2.0.205722",
46
46
  "@fluidframework/protocol-definitions": "^3.0.0",
47
- "@fluidframework/runtime-definitions": "2.0.0-dev.7.2.0.204906",
48
- "@fluidframework/runtime-utils": "2.0.0-dev.7.2.0.204906",
49
- "@fluidframework/telemetry-utils": "2.0.0-dev.7.2.0.204906",
47
+ "@fluidframework/runtime-definitions": "2.0.0-dev.7.2.0.205722",
48
+ "@fluidframework/runtime-utils": "2.0.0-dev.7.2.0.205722",
49
+ "@fluidframework/telemetry-utils": "2.0.0-dev.7.2.0.205722",
50
50
  "double-ended-queue": "^2.1.0-0",
51
51
  "events": "^3.1.0",
52
52
  "lz4js": "^0.2.0",
@@ -54,15 +54,15 @@
54
54
  "uuid": "^9.0.0"
55
55
  },
56
56
  "devDependencies": {
57
- "@fluid-internal/stochastic-test-utils": "2.0.0-dev.7.2.0.204906",
57
+ "@fluid-internal/stochastic-test-utils": "2.0.0-dev.7.2.0.205722",
58
58
  "@fluid-tools/benchmark": "^0.48.0",
59
- "@fluid-tools/build-cli": "0.26.0-203096",
60
- "@fluidframework/build-common": "^2.0.2",
61
- "@fluidframework/build-tools": "0.26.0-203096",
59
+ "@fluid-tools/build-cli": "^0.26.1",
60
+ "@fluidframework/build-common": "^2.0.3",
61
+ "@fluidframework/build-tools": "^0.26.1",
62
62
  "@fluidframework/container-runtime-previous": "npm:@fluidframework/container-runtime@2.0.0-internal.7.1.0",
63
63
  "@fluidframework/eslint-config-fluid": "^3.0.0",
64
- "@fluidframework/mocha-test-setup": "2.0.0-dev.7.2.0.204906",
65
- "@fluidframework/test-runtime-utils": "2.0.0-dev.7.2.0.204906",
64
+ "@fluidframework/mocha-test-setup": "2.0.0-dev.7.2.0.205722",
65
+ "@fluidframework/test-runtime-utils": "2.0.0-dev.7.2.0.205722",
66
66
  "@microsoft/api-extractor": "^7.37.0",
67
67
  "@types/double-ended-queue": "^2.1.0",
68
68
  "@types/events": "^3.0.0",
@@ -97,7 +97,7 @@
97
97
  "build:genver": "gen-version",
98
98
  "build:test": "tsc --project ./src/test/tsconfig.json",
99
99
  "ci:build:docs": "api-extractor run",
100
- "clean": "rimraf --glob 'dist' 'lib' '*.tsbuildinfo' '*.build.log' '_api-extractor-temp' 'nyc'",
100
+ "clean": "rimraf --glob dist lib \"*.tsbuildinfo\" \"*.build.log\" _api-extractor-temp nyc",
101
101
  "eslint": "eslint --format stylish src",
102
102
  "eslint:fix": "eslint --format stylish src --fix --fix-type problem,suggestion,layout",
103
103
  "format": "npm run prettier:fix",
@@ -167,6 +167,7 @@ export class BlobManager extends TypedEventEmitter<IBlobManagerEvents> {
167
167
  private readonly tombstonedBlobs: Set<string> = new Set();
168
168
 
169
169
  private readonly sendBlobAttachOp: (localId: string, storageId?: string) => void;
170
+ private stopAttaching: boolean = false;
170
171
 
171
172
  constructor(
172
173
  private readonly routeContext: IFluidHandleContext,
@@ -518,7 +519,7 @@ export class BlobManager extends TypedEventEmitter<IBlobManagerEvents> {
518
519
  private onUploadResolve(localId: string, response: ICreateBlobResponseWithTTL) {
519
520
  const entry = this.pendingBlobs.get(localId);
520
521
  assert(entry !== undefined, 0x6c8 /* pending blob entry not found for uploaded blob */);
521
- if (entry.abortSignal?.aborted === true && !entry.opsent) {
522
+ if ((entry.abortSignal?.aborted === true && !entry.opsent) || this.stopAttaching) {
522
523
  this.deletePendingBlob(localId);
523
524
  return;
524
525
  }
@@ -899,7 +900,9 @@ export class BlobManager extends TypedEventEmitter<IBlobManagerEvents> {
899
900
  }
900
901
  }
901
902
 
902
- public async attachAndGetPendingBlobs(): Promise<IPendingBlobs | undefined> {
903
+ public async attachAndGetPendingBlobs(
904
+ stopBlobAttachingSignal?: AbortSignal,
905
+ ): Promise<IPendingBlobs | undefined> {
903
906
  return PerformanceEvent.timedExecAsync(
904
907
  this.mc.logger,
905
908
  { eventName: "GetPendingBlobs" },
@@ -914,12 +917,17 @@ export class BlobManager extends TypedEventEmitter<IBlobManagerEvents> {
914
917
  for (const [id, entry] of this.pendingBlobs) {
915
918
  if (!localBlobs.has(entry)) {
916
919
  localBlobs.add(entry);
917
- if (!entry.opsent) {
918
- this.sendBlobAttachOp(id, entry.storageId);
919
- }
920
920
  entry.handleP.resolve(this.getBlobHandle(id));
921
921
  attachBlobsP.push(
922
- new Promise<void>((resolve) => {
922
+ new Promise<void>((resolve, reject) => {
923
+ stopBlobAttachingSignal?.addEventListener(
924
+ "abort",
925
+ () => {
926
+ this.stopAttaching = true;
927
+ reject(new Error("Operation aborted"));
928
+ },
929
+ { once: true },
930
+ );
923
931
  const onBlobAttached = (attachedEntry) => {
924
932
  if (attachedEntry === entry) {
925
933
  this.off("blobAttached", onBlobAttached);
@@ -935,11 +943,21 @@ export class BlobManager extends TypedEventEmitter<IBlobManagerEvents> {
935
943
  );
936
944
  }
937
945
  }
938
- await Promise.all(attachBlobsP);
946
+ await Promise.allSettled(attachBlobsP).catch(() => {});
939
947
  }
940
948
 
941
949
  for (const [id, entry] of this.pendingBlobs) {
950
+ if (stopBlobAttachingSignal?.aborted && !entry.attached) {
951
+ this.mc.logger.sendTelemetryEvent({
952
+ eventName: "UnableToStashBlob",
953
+ id,
954
+ });
955
+ continue;
956
+ }
942
957
  assert(entry.attached === true, 0x790 /* stashed blob should be attached */);
958
+ if (!entry.opsent) {
959
+ this.sendBlobAttachOp(id, entry.storageId);
960
+ }
943
961
  blobs[id] = {
944
962
  blob: bufferToString(entry.blob, "base64"),
945
963
  storageId: entry.storageId,
@@ -25,6 +25,7 @@ import {
25
25
  ILoaderOptions,
26
26
  ILoader,
27
27
  LoaderHeader,
28
+ IGetPendingLocalStateProps,
28
29
  } from "@fluidframework/container-definitions";
29
30
  import {
30
31
  IContainerRuntime,
@@ -3932,9 +3933,7 @@ export class ContainerRuntime
3932
3933
 
3933
3934
  public notifyAttaching() {} // do nothing (deprecated method)
3934
3935
 
3935
- public async getPendingLocalState(props?: {
3936
- notifyImminentClosure: boolean;
3937
- }): Promise<unknown> {
3936
+ public async getPendingLocalState(props?: IGetPendingLocalStateProps): Promise<unknown> {
3938
3937
  return PerformanceEvent.timedExecAsync(
3939
3938
  this.mc.logger,
3940
3939
  {
@@ -3944,6 +3943,7 @@ export class ContainerRuntime
3944
3943
  async (event) => {
3945
3944
  this.verifyNotClosed();
3946
3945
  const waitBlobsToAttach = props?.notifyImminentClosure;
3946
+ const stopBlobAttachingSignal = props?.stopBlobAttachingSignal;
3947
3947
  if (this._orderSequentiallyCalls !== 0) {
3948
3948
  throw new UsageError("can't get state during orderSequentially");
3949
3949
  }
@@ -3952,7 +3952,7 @@ export class ContainerRuntime
3952
3952
  // to close current batch.
3953
3953
  this.flush();
3954
3954
  const pendingAttachmentBlobs = waitBlobsToAttach
3955
- ? await this.blobManager.attachAndGetPendingBlobs()
3955
+ ? await this.blobManager.attachAndGetPendingBlobs(stopBlobAttachingSignal)
3956
3956
  : undefined;
3957
3957
  const pending = this.pendingStateManager.getLocalState();
3958
3958
  if (!pendingAttachmentBlobs && !this.hasPendingMessages()) {
@@ -6,4 +6,4 @@
6
6
  */
7
7
 
8
8
  export const pkgName = "@fluidframework/container-runtime";
9
- export const pkgVersion = "2.0.0-dev.7.2.0.204906";
9
+ export const pkgVersion = "2.0.0-dev.7.2.0.205722";