aws / aws/jsii

jsii libraries are not thread-safe

Open
#685 6 comments 7 reactions 0 assignees View on GitHub
effort/large feature-request language/java p2
Dominant language
TypeScript
Stars
2.9k
Forks
267
Avg merge
1d 25m
Merged PRs (30d)
14

Description

## :rocket: Feature Request

### Affected Languages

- [ ] `TypeScript` or `Javascript`
- [ ] `Python`
- [x] `Java`
- [ ] .NET (`C#`, `F#`, ...)

### General Information
* **JSII Version:** 0.14.2
* **Platform:**

### What is the problem?
```
Exception in thread "Thread-1" software.amazon.jsii.JsiiException: Malformed object reference. Expecting $jsii.byref
at software.amazon.jsii.JsiiObjectRef.parse(JsiiObjectRef.java:52)
at software.amazon.jsii.JsiiClient.createObject(JsiiClient.java:91)
at software.amazon.jsii.JsiiEngine.createNewObject(JsiiEngine.java:458)
```

When trying to run jsiiengine createNewObject in a multithreaded env, it causes above exception.

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the multithreaded createNewObject failure and trace the stack through JsiiEngine.createNewObject, JsiiClient.createObject, and JsiiObjectRef.parse. Determine which shared runtime state causes the malformed object reference, then add a regression test covering concurrent Java calls and verify that the exception no longer occurs.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, typescript
Domain
tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
32/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.