You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
(rms/cms).WithTracingContext() and .WithTracer() are misnomers, they should be .Set*(). Comments are either ambiguous "A MultiStore is returned"... (which one?), or wrong "It returns a modified MultiStore"... (it returns the same multistore and also happens to modify it in place).
(rms/cms).CacheWrap().WithTracingContext() modifies the traceContext dict of the orignal/parent MultiStore, which doesn't make sense. A CacheWrap()'d thing should not affect the wrapped thing (in general, until .Write()). In terms of a "trace context", it should probably never modify the parent's "trace context".
cms.WithTracingContext() doesn’t always apply the tracing context until ms.CacheWrap/CacheMultiStore is called, whereas rms.WithTracingContext() does (e.g. rms.GetKVStore() uses the new tracing context, whereas cms.GetKVStore() does not, unless the cms itself was constructed with a tracing context first from the parent MultiStore, in which case two wrongs make a "right" because of the earlier mentioned issue of parent-tracing-context-overwriting). And otherwise, (rms/cms).CacheWrapWithTrace() doesn't use its args at all.
The fix to all of this, I think, is:
Implement TracingMultiStore and use it in (rms/cms).CacheWrapWithTrace().
(rms/cms).WithTracingContext() and .WithTracer() are misnomers, they should be .Set*(). Comments are either ambiguous "A MultiStore is returned"... (which one?), or wrong "It returns a modified MultiStore"... (it returns the same multistore and also happens to modify it in place).
(rms/cms).CacheWrap().WithTracingContext() modifies the traceContext dict of the orignal/parent MultiStore, which doesn't make sense. A CacheWrap()'d thing should not affect the wrapped thing (in general, until .Write()). In terms of a "trace context", it should probably never modify the parent's "trace context".
cms.WithTracingContext() doesn’t always apply the tracing context until ms.CacheWrap/CacheMultiStore is called, whereas rms.WithTracingContext() does (e.g. rms.GetKVStore() uses the new tracing context, whereas cms.GetKVStore() does not, unless the cms itself was constructed with a tracing context first from the parent MultiStore, in which case two wrongs make a "right" because of the earlier mentioned issue of parent-tracing-context-overwriting). And otherwise, (rms/cms).CacheWrapWithTrace() doesn't use its args at all.
The fix to all of this, I think, is:
The text was updated successfully, but these errors were encountered: