apache / apache/texera

AcquireLockRequest fails when no collaboration lock is held

Open
#8,097 1 comment 0 reactions 1 assignee Claimed by @carloea2 View on GitHub
Dominant language
Scala
Stars
314
Forks
187
Avg merge
1d 21h
Merged PRs (30d)
214

Description

### Feature Summary

Root cause: AcquireLockRequest reads the collaboration lock holder map with direct indexing even when the workflow has no holder entry or stores the null no-holder marker.

Before: requesting an unheld lock raises NoSuchElementException and the client receives no lock event.

Expected: the requester becomes the holder and receives LockGrantedEvent.

Reproduction evidence:

1. Start Texera locally.
2. Open an anonymous connection to the collaboration WebSocket.
3. Register a workflow and send AcquireLockRequest while no holder exists.
4. Observe that the client times out and the server logs NoSuchElementException.

The same failure occurs after a holder disconnects and leaves the null no-holder marker. The focused regression suite reproduced both states with 27 tests passing and 2 failing.

Version and commit evidence:

1.3.0-incubating-SNAPSHOT on main

**Commit Hash (Optional)**
2173ec57fc

## Browsers

Not browser specific. Reproduced through the live localhost WebSocket endpoint.

## Relevant log output

java.util.NoSuchElementException: key not found

### Proposed Solution or Design

Expected: the requester becomes the holder and receives LockGrantedEvent.

### Affected Area

Workflow Engine (Amber)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.