# Make deadlock detection within DataConverter optional

**URL:** <https://community.temporal.io/t/make-deadlock-detection-within-dataconverter-optional/7631>\
**Category:** Community Support\
**Tags:** java-sdk, data-converter\
**Created:** [March 20, 2023, 4:08pm UTC](https://community.temporal.io/t/make-deadlock-detection-within-dataconverter-optional/7631 "2023-03-20T16:08:54Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sai\_Kiran\_Dasika](https://sea2.discourse-cdn.com/flex016/user_avatar/community.temporal.io/sai_kiran_dasika/32/5408_2.png) [@Sai\_Kiran\_Dasika](https://community.temporal.io/u/Sai_Kiran_Dasika)\
**Post date:** [March 20, 2023, 4:08pm UTC](https://community.temporal.io/t/make-deadlock-detection-within-dataconverter-optional/7631/1 "2023-03-20T16:08:54Z")

</div>

Hi,  
I currently have a `DataConverter` implemented that talks to a remote server for encrypting/decrypting data. The temporal _java-sdk_ seems to be thinking that there is a deadlock when the remote server takes a little long to respond. According to other posts I’ve seen on this forum it looks like the deadlock detection timeout is 1s. Is there a way to make this optional in the java-sdk 1.7.1?

Looking at the sdk-go project there is a dataconverter that can be instantiated without deadlock detection.

There’s an open issue in the library to get this done. I was wondering if it has picked up any traction?

> <https://github.com/temporalio/sdk-java/issues/1301>
>
> \*\*Is your feature request related to a problem? Please describe.\*\*
> Some users h…ave data converters that perform an IO and they sometimes trigger deadline detector. 
> 
> \*\*Describe the solution you'd like\*\*
> JavaSDK should have a way to disable deadline detector for a piece of code (under \`WorkflowUnsafe\`) and for a specific data converter.
> See implementation in GoSDK as a reference: https://github.com/temporalio/sdk-go/pull/772

---

<div class="post-metadata">

**Author:** ![tihomir](https://sea2.discourse-cdn.com/flex016/user_avatar/community.temporal.io/tihomir/32/6580_2.png) [@tihomir](https://community.temporal.io/u/tihomir)\
**Post date:** [March 20, 2023, 10:57pm UTC](https://community.temporal.io/t/make-deadlock-detection-within-dataconverter-optional/7631/2 "2023-03-20T22:57:48Z")

</div>

For Java SDK see feature request [here](https://github.com/temporalio/sdk-java/issues/1301).

> when the remote server takes a little long to respond

Is is requirement to offload the encryption/decryption to a remove service? Have seen this type of use case before and user changed it to only get the encrypt keys from service and do the actual work on the worker (inside data converter).  
It’s not typically recommended to do the encrypt/decrypt locally on workers, not remotely.

---

<div class="post-metadata">

**Author:** ![tihomir](https://sea2.discourse-cdn.com/flex016/user_avatar/community.temporal.io/tihomir/32/6580_2.png) [@tihomir](https://community.temporal.io/u/tihomir)\
**Post date:** [March 20, 2023, 11:32pm UTC](https://community.temporal.io/t/make-deadlock-detection-within-dataconverter-optional/7631/3 "2023-03-20T23:32:37Z")

</div>

Just wanted to add, SDK does allow you to change the default deadlock detection timeout via

`WorkerOptions.newBuilder().setDefaultDeadlockDetectionTimeout`

but this is not something recommended to do.

---

<div class="post-metadata">

**Author:** ![Sai\_Kiran\_Dasika](https://sea2.discourse-cdn.com/flex016/user_avatar/community.temporal.io/sai_kiran_dasika/32/5408_2.png) [@Sai\_Kiran\_Dasika](https://community.temporal.io/u/Sai_Kiran_Dasika)\
**Post date:** [March 21, 2023, 12:07am UTC](https://community.temporal.io/t/make-deadlock-detection-within-dataconverter-optional/7631/4 "2023-03-21T00:07:12Z")

</div>

Yea as a workaround I’m increasing the timeout using the WorkflowOptions builder. Can there be any unforeseen issues with configuring this value?

Thanks.

---

<div class="post-metadata">

**Author:** ![tihomir](https://sea2.discourse-cdn.com/flex016/user_avatar/community.temporal.io/tihomir/32/6580_2.png) [@tihomir](https://community.temporal.io/u/tihomir)\
**Post date:** [March 21, 2023, 12:33am UTC](https://community.temporal.io/t/make-deadlock-detection-within-dataconverter-optional/7631/5 "2023-03-21T00:33:02Z")

</div>

> using the WorkflowOptions builder

Do you mean WorkerOptions right?

> Can there be any unforeseen issues with configuring this value?

I think in general relying on third party services to encrypt/decrypt could lead to possible issues. If you for example have a larger number of input parameters (to activity, local activity, child workflow) and let’s say it takes seconds to encode/decode each (payload) i think you can run into workflow task timeouts (default 10s) fairly easily.

Think best to really use this as a temporary workaround, and try to do encryption/decryption locally on worker.

---

<div class="post-metadata">

**Author:** ![Sai\_Kiran\_Dasika](https://sea2.discourse-cdn.com/flex016/user_avatar/community.temporal.io/sai_kiran_dasika/32/5408_2.png) [@Sai\_Kiran\_Dasika](https://community.temporal.io/u/Sai_Kiran_Dasika)\
**Post date:** [March 21, 2023, 12:50am UTC](https://community.temporal.io/t/make-deadlock-detection-within-dataconverter-optional/7631/6 "2023-03-21T00:50:07Z")

</div>

Yea WorkerOptions my bad.

I’ll look into encrypting locally. Thanks for the input.
