queue_v2.go ×4

Frontier kind: Code frontier

unlabeled · c_776c349cc920

5 tests · 3259 LOC · 157 files · introduces 0 tests · 32 LOC · 2 files

Introduces — evidence that enters the hierarchy at this concept

Code
5 ranges32 lines · 2 files
Tests
0 tests

Contains — complete concept membership

All code (extent)
534 ranges3259 lines · 157 files · Browse complete extent
All tests (intent)
5 testsBrowse complete intent

Neighbourhood graph

The orange circle is the focus. Violet and green circles are every ancestor and descendant, broader and narrower, at any distance; blue squares and pink diamonds are the introduced files and exact introduced tests of every visible concept, not only the focus's. Arrows point from broader to narrower concepts and bridge only concepts omitted from this view. Undirected links show source or test introduction. Concept and file size follows LOC; exact test nodes use test-count units.

Introduced files, introduced tests, and structurally relevant concept specialization

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 native relationship evidence on this page.

Graph controls are ready.

Interactive rendering requires JavaScript and WebGL. Use the native relationship evidence on this page while the interactive map is unavailable.

Native relationship evidence

Every exact file and test below is linked only from the concept that introduces it.

Introduced tests

Every collected test enters the hierarchy at exactly one concept.

No tests are introduced at this concept. Its intent tests are introduced by other concepts.

Introduced code

Every collected source range enters the hierarchy at exactly one concept.

2 files ranked by introduced lines: 32 introduced LOC across 5 ranges. Expand a file to inspect source; the > gutter marks introduced lines.

go.temporal.io/server/common/persistence/sql/sqlplugin/tests/queue_v2.go 25 introduced LOC · 4 ranges

Open complete file

165 *tx.commitCalls++
166 if tx.db.txCommitErr != nil {
167 > err := tx.Rollback() queue_v2.go
168 > if err != nil {
169 return err
170 }
171 > return tx.db.txCommitErr queue_v2.go
172 }
173 return tx.Tx.Commit()
201 })
202 t.Run("TxCommitFails", func(t *testing.T) {
203 > t.Parallel() queue_v2.go
204 > testCommitTxFails(ctx, t, baseDB)
205 > })
206 t.Run("FailedToGetLastMessageIDFromDB", func(t *testing.T) {
207 t.Parallel()
281 }
282
283 > func testCommitTxFails(ctx context.Context, t *testing.T, baseDB sqlplugin.DB) { queue_v2.go
284 > queueType := persistence.QueueTypeHistoryNormal
285 > queueName := "test-queue-" + t.Name()
286 > db := &faultyDB{
287 > DB: baseDB,
288 > txCommitErr: ErrTxCommitFailed,
289 > }
290 > logger := &logRecorder{Logger: log.NewTestLogger()}
291 > q := persistencesql.NewQueueV2(db, logger, serialization.NewSerializer())
292 > _, err := q.CreateQueue(ctx, &persistence.InternalCreateQueueRequest{
293 > QueueType: queueType,
294 > QueueName: queueName,
295 > })
296 > require.NoError(t, err)
297 > _, err = persistencetest.EnqueueMessage(context.Background(), q, queueType, queueName)
298 > require.Error(t, err)
299 > assert.ErrorContains(t, err, "EnqueueMessage failed")
300 > assert.Equal(t, db.commitCalls, 1)
301 > }
302
303 func testBeginTxFails(ctx context.Context, t *testing.T, baseDB sqlplugin.DB) {
go.temporal.io/server/common/persistence/sql/queue_v2.go 7 introduced LOC · 1 range

Open complete file

95
96 if err := tx.Commit(); err != nil {
97 > return nil, serviceerror.NewUnavailablef( queue_v2.go
98 > "EnqueueMessage failed for queue with type: %v and name: %v. commit operation failed. Error: %v",
99 > request.QueueType,
100 > request.QueueName,
101 > err,
102 > )
103 > }
104 return &persistence.InternalEnqueueMessageResponse{Metadata: persistence.MessageMetadata{ID: nextMessageID}}, err
105 }