Revert "Default Runtime Request Header Wait Config and Telemetry (#22… (#22955)

Reverting this commit as it causes the FF/Loop pipeline to fail

[ADO
Task](https://dev.azure.com/fluidframework/internal/_workitems/edit/22460)
This commit is contained in:
Sonali Deshpande 2024-11-01 09:17:06 -07:00 коммит произвёл GitHub
Родитель e432720309
Коммит 0c1886ec38
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: B5690EEEBB952194
4 изменённых файлов: 60 добавлений и 67 удалений

Просмотреть файл

@ -71,12 +71,15 @@ import {
createChildMonitoringContext,
extractSafePropertiesFromMessage,
tagCodeArtifacts,
type IConfigProvider,
type ITelemetryPropertiesExt,
} from "@fluidframework/telemetry-utils/internal";
import { v4 as uuid } from "uuid";
import { DeletedResponseHeaderKey, RuntimeHeaderData } from "./containerRuntime.js";
import {
DeletedResponseHeaderKey,
RuntimeHeaderData,
defaultRuntimeHeaderData,
} from "./containerRuntime.js";
import {
IDataStoreAliasMessage,
channelToDataStore,
@ -126,18 +129,6 @@ interface FluidDataStoreMessage {
type: string;
}
function computeRuntimeHeaderData(
config: IConfigProvider,
data: Partial<RuntimeHeaderData>,
): Required<RuntimeHeaderData> {
return {
wait: config.getBoolean("Fluid.ContainerRuntime.WaitHeaderDefault") ?? true,
viaHandle: false,
allowTombstone: false,
...data,
};
}
/**
* Creates a shallow wrapper of {@link IFluidParentContext}. The wrapper can then have its methods overwritten as needed
*/
@ -980,7 +971,7 @@ export class ChannelCollection implements IFluidDataStoreChannel, IDisposable {
requestHeaderData: RuntimeHeaderData,
originalRequest: IRequest,
): Promise<IFluidDataStoreContextInternal> {
const headerData = computeRuntimeHeaderData(this.mc.config, requestHeaderData);
const headerData = { ...defaultRuntimeHeaderData, ...requestHeaderData };
if (
this.checkAndLogIfDeleted(
id,
@ -1028,7 +1019,7 @@ export class ChannelCollection implements IFluidDataStoreChannel, IDisposable {
) {
return undefined;
}
const headerData = computeRuntimeHeaderData(this.mc.config, requestHeaderData);
const headerData = { ...defaultRuntimeHeaderData, ...requestHeaderData };
const context = await this.contexts.getBoundOrRemoted(id, headerData.wait);
if (context === undefined) {
return undefined;

Просмотреть файл

@ -561,6 +561,13 @@ export interface RuntimeHeaderData {
allowTombstone?: boolean;
}
/** Default values for Runtime Headers */
export const defaultRuntimeHeaderData: Required<RuntimeHeaderData> = {
wait: true,
viaHandle: false,
allowTombstone: false,
};
/**
* Available compression algorithms for op compression.
* @legacy

Просмотреть файл

@ -7,7 +7,6 @@ import { IDisposable, ITelemetryBaseLogger } from "@fluidframework/core-interfac
import { assert, Deferred, Lazy } from "@fluidframework/core-utils/internal";
import {
ITelemetryLoggerExt,
PerformanceEvent,
createChildLogger,
} from "@fluidframework/telemetry-utils/internal";
@ -41,7 +40,7 @@ export class DataStoreContexts
.catch((contextError) => {
this._logger.sendErrorEvent(
{
eventName: "DisposeError",
eventName: "FluidDataStoreContextDisposeError",
fluidDataStoreId,
},
contextError,
@ -53,10 +52,7 @@ export class DataStoreContexts
private readonly _logger: ITelemetryLoggerExt;
constructor(baseLogger: ITelemetryBaseLogger) {
this._logger = createChildLogger({
namespace: "FluidDataStoreContexts",
logger: baseLogger,
});
this._logger = createChildLogger({ logger: baseLogger });
}
[Symbol.iterator](): Iterator<[string, FluidDataStoreContext]> {
@ -144,20 +140,11 @@ export class DataStoreContexts
): Promise<FluidDataStoreContext | undefined> {
const deferredContext = this.ensureDeferred(id);
const existing = deferredContext.isCompleted;
return PerformanceEvent.timedExecAsync(
this._logger,
{
eventName: "GetBoundOrRemoted",
wait,
existing,
},
async () => (!wait && !existing ? undefined : deferredContext.promise),
{
start: true,
end: true,
},
);
if (!wait && !deferredContext.isCompleted) {
return undefined;
}
return deferredContext.promise;
}
private ensureDeferred(id: string): Deferred<FluidDataStoreContext> {

Просмотреть файл

@ -26,8 +26,7 @@ import {
IConfigProviderBase,
IRequest,
IRequestHeader,
IFluidHandleInternal,
} from "@fluidframework/core-interfaces/internal";
} from "@fluidframework/core-interfaces";
import { Deferred } from "@fluidframework/core-utils/internal";
import type { SharedCounter } from "@fluidframework/counter/internal";
import type { IChannel } from "@fluidframework/datastore-definitions/internal";
@ -1057,6 +1056,7 @@ describeCompat("stashed ops", "NoCompat", (getTestObjectProvider, apis) => {
it("resends attach op", async function () {
const newMapId = "newMap";
let id;
const pendingOps = await getPendingOps(
testContainerConfig,
provider,
@ -1067,13 +1067,17 @@ describeCompat("stashed ops", "NoCompat", (getTestObjectProvider, apis) => {
const createdDataStore = await runtime.createDataStore(["default"]);
const dataStore = (await createdDataStore.entryPoint.get()) as ITestFluidObject;
id = dataStore.context.id;
const channel = SharedMap.create(dataStore.runtime);
const channel = dataStore.runtime.createChannel(
newMapId,
"https://graph.microsoft.com/types/map",
);
assert.strictEqual(channel.handle.isAttached, false, "Channel should be detached");
((await channel.handle.get()) as SharedObject).bindToContext();
defaultDataStore.root.set("someDataStore", dataStore.handle);
dataStore.root.set(newMapId, channel.handle);
channel.set(testKey, testValue);
(channel as ISharedMap).set(testKey, testValue);
},
);
@ -1082,14 +1086,14 @@ describeCompat("stashed ops", "NoCompat", (getTestObjectProvider, apis) => {
// get new datastore from first container
const entryPoint = (await container1.getEntryPoint()) as ITestFluidObject;
const containerRuntime = entryPoint.context
.containerRuntime as IContainerRuntimeWithResolveHandle_Deprecated;
// TODO: Remove usage of "resolveHandle" AB#6340
const response = await containerRuntime.resolveHandle({ url: `/${id}/${newMapId}` });
const map2 = response.value as ISharedMap;
await provider.ensureSynchronized();
const newDatastore = await entryPoint.root
.get<IFluidHandleInternal<ITestFluidObject>>("someDataStore")
?.get();
const map2 = await newDatastore?.root
.get<IFluidHandleInternal<ISharedMap>>(newMapId)
?.get();
assert.strictEqual(map2?.get(testKey), testValue);
assert.strictEqual(map2.get(testKey), testValue);
});
it("doesn't resend successful attach op", async function () {
@ -1740,6 +1744,7 @@ describeCompat("stashed ops", "NoCompat", (getTestObjectProvider, apis) => {
it("offline attach", async function () {
const newMapId = "newMap";
let id;
// stash attach op
const pendingOps = await getPendingOps(
testContainerConfig,
@ -1751,12 +1756,17 @@ describeCompat("stashed ops", "NoCompat", (getTestObjectProvider, apis) => {
const createdDataStore = await runtime.createDataStore(["default"]);
const dataStore = (await createdDataStore.entryPoint.get()) as ITestFluidObject;
id = dataStore.context.id;
const channel = SharedMap.create(dataStore.runtime);
const channel = dataStore.runtime.createChannel(
newMapId,
"https://graph.microsoft.com/types/map",
);
assert.strictEqual(channel.handle.isAttached, false, "Channel should be detached");
((await channel.handle.get()) as SharedObject).bindToContext();
defaultDataStore.root.set("someDataStore", dataStore.handle);
dataStore.root.set(newMapId, channel.handle);
channel.set(testKey, testValue);
(channel as ISharedMap).set(testKey, testValue);
},
);
@ -1764,13 +1774,12 @@ describeCompat("stashed ops", "NoCompat", (getTestObjectProvider, apis) => {
const container2 = await loadOffline(testContainerConfig, provider, { url }, pendingOps);
{
const entryPoint = (await container2.container.getEntryPoint()) as ITestFluidObject;
const newDatastore = await entryPoint.root
.get<IFluidHandleInternal<ITestFluidObject>>("someDataStore")
?.get();
const map2 = await newDatastore?.root
.get<IFluidHandleInternal<ISharedMap>>(newMapId)
?.get();
assert.strictEqual(map2?.get(testKey), testValue);
const containerRuntime = entryPoint.context
.containerRuntime as IContainerRuntimeWithResolveHandle_Deprecated;
// TODO: Remove usage of "resolveHandle" AB#6340
const response = await containerRuntime.resolveHandle({ url: `/${id}/${newMapId}` });
const map2 = response.value as ISharedMap;
assert.strictEqual(map2.get(testKey), testValue);
map2.set(testKey2, testValue);
}
@ -1779,16 +1788,15 @@ describeCompat("stashed ops", "NoCompat", (getTestObjectProvider, apis) => {
// get new datastore from first container
{
await provider.ensureSynchronized();
const entryPoint = (await container1.getEntryPoint()) as ITestFluidObject;
const newDatastore = await entryPoint.root
.get<IFluidHandleInternal<ITestFluidObject>>("someDataStore")
?.get();
const map3 = await newDatastore?.root
.get<IFluidHandleInternal<ISharedMap>>(newMapId)
?.get();
assert.strictEqual(map3?.get(testKey), testValue);
assert.strictEqual(map3?.get(testKey2), testValue);
const containerRuntime = entryPoint.context
.containerRuntime as IContainerRuntimeWithResolveHandle_Deprecated;
// TODO: Remove usage of "resolveHandle" AB#6340
const response = await containerRuntime.resolveHandle({ url: `/${id}/${newMapId}` });
const map3 = response.value as ISharedMap;
await provider.ensureSynchronized();
assert.strictEqual(map3.get(testKey), testValue);
assert.strictEqual(map3.get(testKey2), testValue);
}
});