go.temporal.io/server/chasm/interceptors.go

67 LOC · 24 covered · 43 uncovered · 4 ranges · 69 concepts · 3 introducers · 14 tests

File neighbourhood

The centred file is linked to every concept that introduces one of its ranges, every test that runs code from the file, and the gray connector concepts standing between those tests and the file's own introducer concepts. Undirected links join concepts to every file where they introduce source and concepts to the tests they introduce; arrows show specialization between the displayed concepts and bridge only concepts omitted from this view. Concept colors match the source ranges below; connector concepts have no source color and are shown in gray.

Focused file, its introducer and connector concepts, their introduced files, and tests that run code from the file

In the embedded map, ordinary wheel input scrolls the page; use the visible controls to zoom and drag to pan. Open the full-screen map for canvas navigation: wheel pans, Ctrl/Command plus wheel zooms, and arrow keys pan when this region is focused. On touch screens, open the full-screen map to pan or pinch. If JavaScript or WebGL is unavailable, use the related-file, concept, and source links on this page.

Focused file, its introducer and connector concepts, their introduced files, and tests that run code from the filego.temporal.io/server/chasm/visibility_manager.go · 180 LOCchasm/visibility_manager…go.temporal.io/server/common/metrics/panic.go · 30 LOCmetrics/panic.goworkflow_handler.go ×11 · 117 introduced LOCworkflow_handler.go ×11common.go ×1 · 11 introduced LOCcommon.go ×1request_response.pb.go ×6 · 246 introduced LOCrequest_response.pb.go ×…visibility_store.go ×17 · 171 introduced LOCvisibility_store.go ×17telemetry.go ×2 · 15 introduced LOCtelemetry.go ×2fx.go ×1 · 4 introduced LOCfx.go ×1collector.go ×7 · 33 introduced LOCcollector.go ×7data_store_factory.go ×29 · 703 introduced LOCdata_store_factory.go ×2…TestNewServer · 0 introduced LOCTestNewServerpri_matcher.go ×1 · 2 introduced LOCpri_matcher.go ×1timer_queue_active_task_executor.go ×1 · 3 introduced LOCtimer_queue_active_task_…TestNewServer · 0 introduced LOCTestNewServermetric_client.go ×3 · 18 introduced LOCmetric_client.go ×3request_response.pb.go ×12 · 137 introduced LOCrequest_response.pb.go ×…workflow_task_completed_handler.go ×9 · 75 introduced LOCworkflow_task_completed_…pri_forwarder.go ×2 · 4 introduced LOCpri_forwarder.go ×2request_response.pb.go ×1 · 7 introduced LOCrequest_response.pb.go ×…logger.go ×1 · 5 introduced LOClogger.go ×1connections.go ×1 · 9 introduced LOCconnections.go ×1persistence_rate_limited_clients.go ×2 · 17 introduced LOCpersistence_rate_limited…logger.go ×1 · 2 introduced LOClogger.go ×1metric_client.go ×2 · 7 introduced LOCmetric_client.go ×2pri_matcher.go ×1 · 4 introduced LOCpri_matcher.go ×1task_queue_partition_manager.go ×2 · 10 introduced LOCtask_queue_partition_man…connections.go ×2 · 12 introduced LOCconnections.go ×2workflow_handler.go ×8 · 144 introduced LOCworkflow_handler.go ×8pri_matcher.go ×1 · 2 introduced LOCpri_matcher.go ×1handler.go ×1 · 20 introduced LOChandler.go ×1pri_matcher.go ×8 · 55 introduced LOCpri_matcher.go ×8matching_engine.go ×1 · 8 introduced LOCmatching_engine.go ×1server.go ×1 · 3 introduced LOCserver.go ×1logger.go ×2 · 21 introduced LOClogger.go ×2queue_scheduled.go ×1 · 2 introduced LOCqueue_scheduled.go ×1handler.go ×25 · 728 introduced LOChandler.go ×25onebox.go ×75 · 1256 introduced LOConebox.go ×75metric_client_gen.go ×4 · 50 introduced LOCmetric_client_gen.go ×4pri_forwarder.go ×1 · 6 introduced LOCpri_forwarder.go ×1matching_service_server_gen.go ×1 · 2 introduced LOCmatching_service_server_…http_api_server.go ×23 · 195 introduced LOChttp_api_server.go ×23db.go ×1 · 2 introduced LOCdb.go ×1pri_task_writer.go ×3 · 14 introduced LOCpri_task_writer.go ×3namespace_handover.go ×3 · 8 introduced LOCnamespace_handover.go ×3task_queue_partition_manager.go ×2 · 4 introduced LOCtask_queue_partition_man…matching_engine.go ×3 · 5 introduced LOCmatching_engine.go ×3service_grpc.pb.go ×19 · 357 introduced LOCservice_grpc.pb.go ×19request_response.pb.go ×6 · 114 introduced LOCrequest_response.pb.go ×…reader.go ×2 · 8 introduced LOCreader.go ×2service_grpc.pb.go ×20 · 740 introduced LOCservice_grpc.pb.go ×20endpoint_registry.go ×2 · 26 introduced LOCendpoint_registry.go ×2server.go ×3 · 13 introduced LOCserver.go ×3scanner.go ×1 · 2 introduced LOCscanner.go ×1mask_internal_error.go ×1 · 2 introduced LOCmask_internal_error.go ×…matching_engine.go ×2 · 5 introduced LOCmatching_engine.go ×2service_resolver.go ×4 · 49 introduced LOCservice_resolver.go ×4lite_server.go ×25 · 303 introduced LOClite_server.go ×25fx.go ×44 · 705 introduced LOCfx.go ×44adaptive_pool.go ×1 · 3 introduced LOCadaptive_pool.go ×1queue_immediate.go ×1 · 1 introduced LOCqueue_immediate.go ×1fx.go ×1 · 1 introduced LOCfx.go ×1service.go ×8 · 413 introduced LOCservice.go ×8rpc.go ×1 · 13 introduced LOCrpc.go ×1queue_scheduled.go ×1 · 1 introduced LOCqueue_scheduled.go ×1fx.go ×1 · 2 introduced LOCfx.go ×1fx.go ×44 · 4693 introduced LOCfx.go ×44TestChasmEngineInterceptor_ShouldRespond · 0 introduced LOCTestChasmEngineIntercept…engine.go ×1 · 7 introduced LOCengine.go ×1interceptors.go ×1 · 11 introduced LOCinterceptors.go ×1interceptors.go ×2 · 12 introduced LOCinterceptors.go ×2interceptors.go ×1 · 7 introduced LOCinterceptors.go ×1TestChasmEngineInterceptor_ShouldRespond · introduced test · go.temporal.io/server/chasm/TestChasmEngineInterceptor_ShouldRespondTestChasmEngineIntercept…TestChasmVisibilityInterceptor_ShouldRespond · introduced test · go.temporal.io/server/chasm/TestChasmVisibilityInterceptor_ShouldRespondTestChasmVisibilityInter…TestNewServer · introduced test · go.temporal.io/server/temporal/TestNewServerTestNewServerTestNewServerWithJSONEncoding · introduced test · go.temporal.io/server/temporal/TestNewServerWithJSONEncodingTestNewServerWithJSONEnc…with_OTEL_Collector_running · introduced test · go.temporal.io/server/temporal/TestNewServerWithOTEL/with_OTEL_Collector_runningwith_OTEL_Collector_runn…without_OTEL_Collector_running · introduced test · go.temporal.io/server/temporal/TestNewServerWithOTEL/without_OTEL_Collector_runningwithout_OTEL_Collector_r…ExampleNewServer · introduced test · go.temporal.io/server/temporaltest/ExampleNewServerExampleNewServerTestBaseServerOptions · introduced test · go.temporal.io/server/temporaltest/TestBaseServerOptionsTestBaseServerOptionsTestClientWithCustomInterceptor · introduced test · go.temporal.io/server/temporaltest/TestClientWithCustomInterceptorTestClientWithCustomInte…TestDefaultWorkerOptions · introduced test · go.temporal.io/server/temporaltest/TestDefaultWorkerOptionsTestDefaultWorkerOptionsTestNewServer · introduced test · go.temporal.io/server/temporaltest/TestNewServerTestNewServerTestNewWorkerWithOptions · introduced test · go.temporal.io/server/temporaltest/TestNewWorkerWithOptionsTestNewWorkerWithOptionsTestSearchAttributeRegistration · introduced test · go.temporal.io/server/temporaltest/TestSearchAttributeRegistrationTestSearchAttributeRegis…TestWorkerServiceHealthCheck · introduced test · go.temporal.io/server/tests/testcore/TestFunctionalTestBaseSuite/TestWorkerServiceHealthCheckTestWorkerServiceHealthC…Focused file · go.temporal.io/server/chasm/interceptors.go · 67 LOCchasm/interceptors.go

Graph controls are ready.

Interactive rendering requires JavaScript and WebGL. Use the related-file, concept, and source links on this page while the interactive map is unavailable.

1 package chasm
2
3 import (
4 "context"
5
6 "go.temporal.io/server/common/log"
7 "go.temporal.io/server/common/metrics"
8 "google.golang.org/grpc"
9 )
10
11 // ChasmEngineInterceptor Interceptor that intercepts RPC requests,
12 // detects CHASM-specific calls and does additional boilerplate processing before
13 // handing off. Visibility is injected separately with
14 // ChasmVisibilityInterceptor.
15 type ChasmEngineInterceptor struct {
16 engine Engine
17 logger log.SnTaggedLogger
18 metricsHandler metrics.Handler
19 }
20
21 func (i *ChasmEngineInterceptor) Intercept(
22 ctx context.Context,
23 req any,
24 info *grpc.UnaryServerInfo,
25 handler grpc.UnaryHandler,
26 > ) (resp any, retError error) { interceptors.go ×1
27 > // Capture panics for any handler method, not just CHASM-specific ones. This could have gone into a separate
28 > // interceptor, but having it here avoids the overhead of adding another layer to the interceptor chain.
29 > defer metrics.CapturePanic(i.logger, i.metricsHandler, &retError)
30 >
31 > ctx = NewEngineContext(ctx, i.engine)
32 > return handler(ctx, req)
33 > }
34
35 func ChasmEngineInterceptorProvider(
36 engine Engine,
37 logger log.Logger,
38 metricsHandler metrics.Handler,
39 > ) *ChasmEngineInterceptor { interceptors.go ×1
40 > return &ChasmEngineInterceptor{
41 > engine: engine,
42 > logger: logger,
43 > metricsHandler: metricsHandler,
44 > }
45 > }
46
47 // ChasmVisibilityInterceptor intercepts RPC requests and adds the CHASM
48 // VisibilityManager to their context.
49 type ChasmVisibilityInterceptor struct {
50 visibilityMgr VisibilityManager
51 }
52
53 func (i *ChasmVisibilityInterceptor) Intercept(
54 ctx context.Context,
55 req any,
56 info *grpc.UnaryServerInfo,
57 handler grpc.UnaryHandler,
58 > ) (resp any, retError error) { interceptors.go ×2
59 > ctx = NewVisibilityManagerContext(ctx, i.visibilityMgr)
60 > return handler(ctx, req)
61 > }
62
63 > func ChasmVisibilityInterceptorProvider(visibilityMgr VisibilityManager) *ChasmVisibilityInterceptor { interceptors.go ×2
64 > return &ChasmVisibilityInterceptor{
65 > visibilityMgr: visibilityMgr,
66 > }
67 > }