go.temporal.io/server/common/log/panic.go

28 LOC · 11 covered · 17 uncovered · 4 ranges · 1589 concepts · 3 introducers · 734 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 fileoperation.go ×8 · 68 introduced LOCoperation.go ×8TestCloseTransaction_ForceUpdateVisibility_RootSAMemoChanged · 0 introduced LOCTestCloseTransaction_For…detached_sub-component_tasks_are_NOT_invalidated_by_parent_pause · 0 introduced LOCdetached_sub-component_t…subtreeIsDirty_resets_after_CloseTransaction, unrelated_sibling_subtree_tasks_are_not_validated · 0 introduced LOCsubtreeIsDirty_resets_af…operation.pb.go ×2 · 9 introduced LOCoperation.pb.go ×2task_processor.go ×4 · 7 introduced LOCtask_processor.go ×4task_processor.go ×7 · 24 introduced LOCtask_processor.go ×7service_grpc.pb.mock.go ×3 · 18 introduced LOCservice_grpc.pb.mock.go …service_grpc.pb.mock.go ×9 · 110 introduced LOCservice_grpc.pb.mock.go …context.go ×1 · 3 introduced LOCcontext.go ×1admin_handler.go ×1 · 6 introduced LOCadmin_handler.go ×1admin_handler.go ×1 · 8 introduced LOCadmin_handler.go ×1admin_handler.go ×9 · 40 introduced LOCadmin_handler.go ×9admin_handler.go ×1 · 2 introduced LOCadmin_handler.go ×1admin_handler.go ×1 · 2 introduced LOCadmin_handler.go ×1admin_handler.go ×5 · 38 introduced LOCadmin_handler.go ×5workflow_handler.go ×6 · 32 introduced LOCworkflow_handler.go ×6workflow_handler.go ×7 · 36 introduced LOCworkflow_handler.go ×7admin_handler.go ×4 · 29 introduced LOCadmin_handler.go ×4workflow_handler.go ×3 · 12 introduced LOCworkflow_handler.go ×3admin_handler.go ×1 · 2 introduced LOCadmin_handler.go ×1admin_handler.go ×1 · 4 introduced LOCadmin_handler.go ×1TestListWorkflowExecutions · 0 introduced LOCTestListWorkflowExecutio…workflow_handler.go ×9 · 44 introduced LOCworkflow_handler.go ×9workflow_handler.go ×19 · 84 introduced LOCworkflow_handler.go ×19workflow_handler.go ×8 · 44 introduced LOCworkflow_handler.go ×8workflow_handler.go ×6 · 11 introduced LOCworkflow_handler.go ×6request_response.pb.go ×7 · 58 introduced LOCrequest_response.pb.go ×…workflow_handler.go ×1 · 2 introduced LOCworkflow_handler.go ×1workflow_handler.go ×3 · 8 introduced LOCworkflow_handler.go ×3TestShutdownWorker · 0 introduced LOCTestShutdownWorkermessage.pb.go ×3 · 12 introduced LOCmessage.pb.go ×3workflow_handler.go ×4 · 8 introduced LOCworkflow_handler.go ×4workflow_handler.go ×1 · 2 introduced LOCworkflow_handler.go ×1workflow_handler.go ×2 · 4 introduced LOCworkflow_handler.go ×2workflow_handler.go ×1 · 3 introduced LOCworkflow_handler.go ×1visibility_manager_mock.go ×1 · 4 introduced LOCvisibility_manager_mock.…workflow_handler.go ×1 · 2 introduced LOCworkflow_handler.go ×1workflow_handler.go ×2 · 9 introduced LOCworkflow_handler.go ×2workflow_handler.go ×3 · 6 introduced LOCworkflow_handler.go ×3workflow_handler.go ×3 · 6 introduced LOCworkflow_handler.go ×3workflow_handler.go ×2 · 4 introduced LOCworkflow_handler.go ×2workflow_handler.go ×5 · 10 introduced LOCworkflow_handler.go ×5workflow_handler.go ×5 · 9 introduced LOCworkflow_handler.go ×5workflow_handler.go ×6 · 11 introduced LOCworkflow_handler.go ×6workflow_handler.go ×1 · 2 introduced LOCworkflow_handler.go ×1workflow_handler.go ×4 · 19 introduced LOCworkflow_handler.go ×4workflow_handler.go ×4 · 7 introduced LOCworkflow_handler.go ×4node_backend_mock.go ×1 · 11 introduced LOCnode_backend_mock.go ×1workflow_handler.go ×3 · 6 introduced LOCworkflow_handler.go ×3workflow_handler.go ×4 · 9 introduced LOCworkflow_handler.go ×4workflow_handler.go ×1 · 2 introduced LOCworkflow_handler.go ×1TestGetSystemInfo · 0 introduced LOCTestGetSystemInfoworkflow_handler.go ×1 · 4 introduced LOCworkflow_handler.go ×1operator_handler.go ×5 · 65 introduced LOCoperator_handler.go ×5schema_version_reader.go ×4 · 77 introduced LOCschema_version_reader.go…operator_handler.go ×1 · 2 introduced LOCoperator_handler.go ×1request_response.pb.go ×1 · 4 introduced LOCrequest_response.pb.go ×…service_grpc.pb.mock.go ×3 · 13 introduced LOCservice_grpc.pb.mock.go …workflowrun_mock.go ×2 · 10 introduced LOCworkflowrun_mock.go ×2stream_receiver.go ×1 · 2 introduced LOCstream_receiver.go ×1workflow_handler.go ×5 · 24 introduced LOCworkflow_handler.go ×5stream_receiver.go ×2 · 5 introduced LOCstream_receiver.go ×2workflow_handler.go ×1 · 3 introduced LOCworkflow_handler.go ×1request_response.pb.go ×1 · 16 introduced LOCrequest_response.pb.go ×…engine_mock.go ×2 · 25 introduced LOCengine_mock.go ×2stream_sender.go ×1 · 3 introduced LOCstream_sender.go ×1service_grpc.pb.mock.go ×2 · 16 introduced LOCservice_grpc.pb.mock.go …stream_sender.go ×2 · 7 introduced LOCstream_sender.go ×2workflow_handler.go ×6 · 23 introduced LOCworkflow_handler.go ×6library.go ×3 · 43 introduced LOClibrary.go ×3task_mock.go ×3 · 14 introduced LOCtask_mock.go ×3workflow_handler.go ×2 · 24 introduced LOCworkflow_handler.go ×2stream_receiver.go ×1 · 1 introduced LOCstream_receiver.go ×1grpc_stream_client.go ×3 · 18 introduced LOCgrpc_stream_client.go ×3stream_receiver.go ×2 · 7 introduced LOCstream_receiver.go ×2stream_receiver.go ×2 · 13 introduced LOCstream_receiver.go ×2validators.go ×4 · 5 introduced LOCvalidators.go ×4operator_handler.go ×1 · 5 introduced LOCoperator_handler.go ×1request_response.pb.go ×1 · 4 introduced LOCrequest_response.pb.go ×…registrable_task.go ×1 · 7 introduced LOCregistrable_task.go ×1tree.go ×1 · 9 introduced LOCtree.go ×1version_checker.go ×2 · 6 introduced LOCversion_checker.go ×2sequential_scheduler.go ×1 · 3 introduced LOCsequential_scheduler.go …session.go ×2 · 9 introduced LOCsession.go ×2TestPanicCapture · 0 introduced LOCTestPanicCapturesession.go ×1 · 5 introduced LOCsession.go ×1session.go ×1 · 4 introduced LOCsession.go ×1TestCapturePanic · 0 introduced LOCTestCapturePanicpanic.go ×1 · 2 introduced LOCpanic.go ×1panic.go ×2 · 7 introduced LOCpanic.go ×2panic.go ×1 · 2 introduced LOCpanic.go ×1TestCloseTransaction_ForceUpdateVisibility_RootSAMemoChanged · introduced test · go.temporal.io/server/chasm/TestNodeSuite/TestCloseTransaction_ForceUpdateVisibility_RootSAMemoChangedTestCloseTransaction_For…detached_sub-component_tasks_are_NOT_invalidated_by_parent_pause · introduced test · go.temporal.io/server/chasm/TestNodeSuite/TestCloseTransaction_PausedStateInvalidatesTasks/detached_sub-component_tasks_are_NOT_invalidated_by_parent_pausedetached_sub-component_t…subtreeIsDirty_resets_after_CloseTransaction · introduced test · go.temporal.io/server/chasm/TestNodeSuite/TestCloseTransaction_TaskValidationSubtreeDirty/subtreeIsDirty_resets_after_CloseTransactionsubtreeIsDirty_resets_af…unrelated_sibling_subtree_tasks_are_not_validated · introduced test · go.temporal.io/server/chasm/TestNodeSuite/TestCloseTransaction_TaskValidationSubtreeDirty/unrelated_sibling_subtree_tasks_are_not_validatedunrelated_sibling_subtre…TestOperation_BuildExecutionInfo_ReturnsIsolatedSearchAttributes · introduced test · go.temporal.io/server/chasm/lib/nexusoperation/TestOperation_BuildExecutionInfo_ReturnsIsolatedSearchAttributesTestOperation_BuildExecu…TestCapturePanic · introduced test · go.temporal.io/server/common/log/TestCapturePanicTestCapturePanicTestPanicCapture · introduced test · go.temporal.io/server/common/persistence/nosql/nosqlplugin/cassandra/gocql/TestPanicCaptureTestPanicCaptureTestSessionEmitsMetricOnRefreshError · introduced test · go.temporal.io/server/common/persistence/nosql/nosqlplugin/cassandra/gocql/TestSessionEmitsMetricOnRefreshErrorTestSessionEmitsMetricOn…TestSubmitProcess_Running_Panic_ShouldCapturePanicAndNackTask · introduced test · go.temporal.io/server/common/tasks/TestSequentialSchedulerSuite/TestSubmitProcess_Running_Panic_ShouldCapturePanicAndNackTaskTestSubmitProcess_Runnin…empty_request · introduced test · go.temporal.io/server/service/frontend/TestAdminHandlerSuite/TestDescribeTaskQueuePartition/empty_requestempty_requestnil_request · introduced test · go.temporal.io/server/service/frontend/TestAdminHandlerSuite/TestDescribeTaskQueuePartition/nil_requestnil_requestnil_request · introduced test · go.temporal.io/server/service/frontend/TestAdminHandlerSuite/TestGetTaskQueueUserData/nil_requestnil_requestTestMigrateScheduleToWorkflowBlockedByWorkflowSentinel · introduced test · go.temporal.io/server/service/frontend/TestAdminHandlerSuite/TestMigrateScheduleToWorkflowBlockedByWorkflowSentinelTestMigrateScheduleToWor…TestMigrateScheduleToWorkflowExistingWorkflow · introduced test · go.temporal.io/server/service/frontend/TestAdminHandlerSuite/TestMigrateScheduleToWorkflowExistingWorkflowTestMigrateScheduleToWor…TestStreamWorkflowReplicationMessages_ClientToServerBroken · introduced test · go.temporal.io/server/service/frontend/TestAdminHandlerSuite/TestStreamWorkflowReplicationMessages_ClientToServerBrokenTestStreamWorkflowReplic…TestStreamWorkflowReplicationMessages_ServerToClientBroken · introduced test · go.temporal.io/server/service/frontend/TestAdminHandlerSuite/TestStreamWorkflowReplicationMessages_ServerToClientBrokenTestStreamWorkflowReplic…Test_ListClusters_Success · introduced test · go.temporal.io/server/service/frontend/TestAdminHandlerSuite/Test_ListClusters_SuccessTest_ListClusters_Succes…fail:_request_is_nil · introduced test · go.temporal.io/server/service/frontend/TestOperatorHandlerSuite/Test_AddSearchAttributes/fail:_request_is_nilfail:_request_is_nilTest_DeleteNamespace · introduced test · go.temporal.io/server/service/frontend/TestOperatorHandlerSuite/Test_DeleteNamespaceTest_DeleteNamespaceTestCountWorkflowExecutions · introduced test · go.temporal.io/server/service/frontend/TestWorkflowHandlerSuite/TestCountWorkflowExecutionsTestCountWorkflowExecuti…TestDescribeBatchOperation_InvalidRequest · introduced test · go.temporal.io/server/service/frontend/TestWorkflowHandlerSuite/TestDescribeBatchOperation_InvalidRequestTestDescribeBatchOperati…TestDescribeWorkflowExecution_CompletedStatus · introduced test · go.temporal.io/server/service/frontend/TestWorkflowHandlerSuite/TestDescribeWorkflowExecution_CompletedStatusTestDescribeWorkflowExec…TestDescribeWorkflowExecution_RunningStatus · introduced test · go.temporal.io/server/service/frontend/TestWorkflowHandlerSuite/TestDescribeWorkflowExecution_RunningStatusTestDescribeWorkflowExec…TestDisableListVisibilityByFilter · introduced test · go.temporal.io/server/service/frontend/TestWorkflowHandlerSuite/TestDisableListVisibilityByFilterTestDisableListVisibilit…operations_list_that_is_not_[Start,_Update]_is_invalid · introduced test · go.temporal.io/server/service/frontend/TestWorkflowHandlerSuite/TestExecuteMultiOperation/operations_list_that_is_not_[Start,_Update]_is_invalidoperations_list_that_is_…TestGetSearchAttributes · introduced test · go.temporal.io/server/service/frontend/TestWorkflowHandlerSuite/TestGetSearchAttributesTestGetSearchAttributesTestGetSystemInfo · introduced test · go.temporal.io/server/service/frontend/TestWorkflowHandlerSuite/TestGetSystemInfoTestGetSystemInfoTestListArchivedVisibility_Failure_ClusterNotConfiguredForArchival · introduced test · go.temporal.io/server/service/frontend/TestWorkflowHandlerSuite/TestListArchivedVisibility_Failure_ClusterNotConfiguredForArchivalTestListArchivedVisibili…TestListBatchOperations · introduced test · go.temporal.io/server/service/frontend/TestWorkflowHandlerSuite/TestListBatchOperationsTestListBatchOperationsTestListBatchOperations_InvalidRerquest · introduced test · go.temporal.io/server/service/frontend/TestWorkflowHandlerSuite/TestListBatchOperations_InvalidRerquestTestListBatchOperations_…TestListWorkflowExecutions · introduced test · go.temporal.io/server/service/frontend/TestWorkflowHandlerSuite/TestListWorkflowExecutionsTestListWorkflowExecutio…no_trigger_should_not_call_history_client · introduced test · go.temporal.io/server/service/frontend/TestWorkflowHandlerSuite/TestPatchSchedule_TriggerImmediatelyScheduledTime/no_trigger_should_not_call_history_clientno_trigger_should_not_ca…trigger_with_existing_ScheduledTime_should_not_be_modified · introduced test · go.temporal.io/server/service/frontend/TestWorkflowHandlerSuite/TestPatchSchedule_TriggerImmediatelyScheduledTime/trigger_with_existing_ScheduledTime_should_not_be_modifiedtrigger_with_existing_Sc…nil_request_should_return_error · introduced test · go.temporal.io/server/service/frontend/TestWorkflowHandlerSuite/TestPatchSchedule_ValidationAndErrors/nil_request_should_return_errornil_request_should_retur…TestRequestCancelWorkflowExecution_Failed_InvalidLinks · introduced test · go.temporal.io/server/service/frontend/TestWorkflowHandlerSuite/TestRequestCancelWorkflowExecution_Failed_InvalidLinksTestRequestCancelWorkflo…normal_kind_preserved · introduced test · go.temporal.io/server/service/frontend/TestWorkflowHandlerSuite/TestRespondNexusTaskCompleted_PreservesTaskQueueKindFromToken/normal_kind_preservednormal_kind_preservedworker_commands_kind_preserved · introduced test · go.temporal.io/server/service/frontend/TestWorkflowHandlerSuite/TestRespondNexusTaskCompleted_PreservesTaskQueueKindFromToken/worker_commands_kind_preservedworker_commands_kind_pre…normal_kind_preserved · introduced test · go.temporal.io/server/service/frontend/TestWorkflowHandlerSuite/TestRespondNexusTaskFailed_PreservesTaskQueueKindFromToken/normal_kind_preservednormal_kind_preservedworker_commands_kind_preserved · introduced test · go.temporal.io/server/service/frontend/TestWorkflowHandlerSuite/TestRespondNexusTaskFailed_PreservesTaskQueueKindFromToken/worker_commands_kind_preservedworker_commands_kind_pre…TestShutdownWorker · introduced test · go.temporal.io/server/service/frontend/TestWorkflowHandlerSuite/TestShutdownWorkerTestShutdownWorkerTestSignalWorkflowExecution_Failed_InvalidLinks · introduced test · go.temporal.io/server/service/frontend/TestWorkflowHandlerSuite/TestSignalWorkflowExecution_Failed_InvalidLinksTestSignalWorkflowExecut…TestStopBatchOperation · introduced test · go.temporal.io/server/service/frontend/TestWorkflowHandlerSuite/TestStopBatchOperationTestStopBatchOperationTestStopBatchOperation_InvalidRequest · introduced test · go.temporal.io/server/service/frontend/TestWorkflowHandlerSuite/TestStopBatchOperation_InvalidRequestTestStopBatchOperation_I…TestUpdateActivityOptions_Priority · introduced test · go.temporal.io/server/service/frontend/TestWorkflowHandlerSuite/TestUpdateActivityOptions_PriorityTestUpdateActivityOption…TestUpdateWorkflowExecutionOptions_Priority · introduced test · go.temporal.io/server/service/frontend/TestWorkflowHandlerSuite/TestUpdateWorkflowExecutionOptions_PriorityTestUpdateWorkflowExecut…TestUpdateWorkflowExecutionOptions_TimeSkipping_DCDisabled · introduced test · go.temporal.io/server/service/frontend/TestWorkflowHandlerSuite/TestUpdateWorkflowExecutionOptions_TimeSkipping_DCDisabledTestUpdateWorkflowExecut…TestRecvEventLoop_Panic_Captured · introduced test · go.temporal.io/server/service/history/replication/TestStreamReceiverSuite/TestRecvEventLoop_Panic_CapturedTestRecvEventLoop_Panic_…TestSendEventLoop_Panic_Captured · introduced test · go.temporal.io/server/service/history/replication/TestStreamReceiverSuite/TestSendEventLoop_Panic_CapturedTestSendEventLoop_Panic_…TestRecvEventLoop_Panic_ShouldCaptureAsError · introduced test · go.temporal.io/server/service/history/replication/TestStreamSenderSuite/TestRecvEventLoop_Panic_ShouldCaptureAsErrorTestRecvEventLoop_Panic_…TestRecvEventLoop_RpcError_ShouldReturnStreamError · introduced test · go.temporal.io/server/service/history/replication/TestStreamSenderSuite/TestRecvEventLoop_RpcError_ShouldReturnStreamErrorTestRecvEventLoop_RpcErr…TestSendEventLoop_Panic_ShouldCaptureAsError · introduced test · go.temporal.io/server/service/history/replication/TestStreamSenderSuite/TestSendEventLoop_Panic_ShouldCaptureAsErrorTestSendEventLoop_Panic_…TestHandleReplicationTask_Panic · introduced test · go.temporal.io/server/service/history/replication/TestTaskProcessorSuite/TestHandleReplicationTask_PanicTestHandleReplicationTas…RespondNexusTaskCompleted · introduced test · go.temporal.io/server/service/matching/TestNexusHandlersEmitClientNameMetric/RespondNexusTaskCompletedRespondNexusTaskComplete…TestVerifyCompatibleVersion · introduced test · go.temporal.io/server/tools/tests/TestVersionTestSuite/TestVerifyCompatibleVersionTestVerifyCompatibleVers…Focused file · go.temporal.io/server/common/log/panic.go · 28 LOClog/panic.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 log
2
3 import (
4 "fmt"
5 "runtime/debug"
6
7 "go.temporal.io/api/serviceerror"
8 "go.temporal.io/server/common/log/tag"
9 )
10
11 // CapturePanic is used to capture panic, it will log the panic and also return the error through pointer.
12 // If the panic value is not error then a default error is returned
13 // We have to use pointer is because in golang: "recover return nil if was not called directly by a deferred function."
14 // And we have to set the returned error otherwise our handler will return nil as error which is incorrect
15 > func CapturePanic(logger Logger, retError *error) { panic.go ×1
16 > if panicObj := recover(); panicObj != nil {
17 > err, ok := panicObj.(error) panic.go ×2
18 > if !ok {
19 > err = fmt.Errorf("panic: %v", panicObj) panic.go ×1
20 > }
21
22 > st := string(debug.Stack()) panic.go ×2
23 >
24 > logger.Error("Panic is captured", tag.SysStackTrace(st), tag.Error(err))
25 >
26 > *retError = serviceerror.NewInternal(err.Error())
27 }
28 }