digital-asset / daml

The Daml smart contract language
https://www.digitalasset.com/developers
Other
802 stars 204 forks source link

Java bindings seem to be affected by a deadlock #13645

Closed stefanobaghino-da closed 2 years ago

stefanobaghino-da commented 2 years ago

Affected Daml version

2.0.0

Bug description

An apparent deadlock in the Java bindings has been reported on the forum: https://discuss.daml.com/t/commandclient-submit-only-answered-7-times-by-the-ledger-when-using-java-bindings-for-2-0/4285

A repro on an application is available here: https://docs.google.com/document/d/1nel-JKTxR00Gb2ruDuu8Fl64cyt6wKJMkFkbKQJvCKU/edit

The Java app mentioned in the full repro document uses blockingGet, which is probably poisonous. Its usage should be investigated to make sure whether this is an application or library issue.

A similar problem seems to have occurred as the Java bindings examples (which also use blockingGet, unfortunately) were being upgraded: https://github.com/digital-asset/ex-java-bindings/pull/14

The source of the issue may be the following: https://github.com/digital-asset/daml/pull/12425 I recommend trying to see if reverting this change fixes the issue. If so, offloading the command onto the sequencer pool might have been a mistake and requires some extra thinking.

realvictorprm commented 2 years ago

I reverted the changes locally, made a local snapshot and so far for the updated ex-java-bindings it doesn't seem to fix the problem of them not working. I'm currently continuing to let it run to see whether I will get a message regarding deadlocks.

realvictorprm commented 2 years ago

OK no Deadlock from that, however it seems something changed that causes the only slightly modified example code not to work :/