question

Upvotes
Accepted
1 0 0 1

Potential deadlock with OmmConsumer

We are creating an EMA consumer, and then opening item streams (100 items batched in each ReqMsg) with the consumer. We simply stop seeing new messages a few minutes after the consumer is established, without any exceptions or errors. This happens while the loop of opening item streams is ongoing. Debugging shows that there is potentially a deadlock situation occurring, as illustrated by the stack traces below. Is there some kind of rate/limit as to how batched requests should be created (we have a single Machine ID and hence a single EMA consumer). Version used is 3.6.7.1, running Kotlin. The core code used to batch requests is below


private suspend fun requestBatchRics(rics: List<String>) {
rics.chunked(100).forEach {
    val ricArray = EmaFactory.createOmmArray().apply {
        it.forEach { ric -> add(EmaFactory.createOmmArrayEntry().ascii(ric)) }
    }

    val batchList = EmaFactory.createElementList().apply {
        add(EmaFactory.createElementEntry().array(EmaRdm.ENAME_BATCH_ITEM_LIST, ricArray))
        if (REQUEST_SUBSET_MARKET_DATA_FIELDS) {
            val viewDataArray = EmaFactory.createOmmArray().apply {
                FIELD_IDS.values.forEach { fieldValue ->
                    add(EmaFactory.createOmmArrayEntry().intValue(fieldValue))
                }
            }

            add(EmaFactory.createElementEntry().uintValue(EmaRdm.ENAME_VIEW_TYPE, 1))
            add(EmaFactory.createElementEntry().array(EmaRdm.ENAME_VIEW_DATA, viewDataArray))
        }
    }

    EmaFactory.createReqMsg()

    val requestMessage = EmaFactory
        .createReqMsg()
        .serviceName(service)
        .payload(batchList)

    consumer.registerClient(reqMsg, this)
}


1667882413559.png

#technology#productema-apimulti-threadingommconsumer
1667882413559.png (324.5 KiB)
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Upvotes
Accepted
15.5k 32 5 10

Hi @charanya

Please be informed that it's mentioned in issue #218 on GitHub that this is fixed in the Real-Time-SDK-2.0.8.L1.

icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Upvotes
86.2k 292 53 79

@charanya

Thanks for reaching out to us.

I found that issue #218 has been submitted on GitHub.

Please wait for the response from the development team on GitHub.

icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.