Payments not in the response of /accounts/{accountId}/invoices even with includeInvoiceComponents=true

78 views
Skip to first unread message

vivek rao

unread,
Jun 20, 2024, 3:52:20 AMJun 20
to Kill Bill users mailing-list
Hello,

We are calling the API : /accounts/{accountId}/invoices 
includeInvoiceComponents=true

In the response we see that it includes all the invoice items but no details related to the associated payments for this invoice.

The call stack shows the API is making payment related calls 
{
   "rawData" : [
      {
         "calls" : [
            {
               "calls" : [
                  {
                     "durationUsec" : 775,
                     "name" : "DAO_CONNECTION:get"
                  },
                  {
                     "calls" : [
                        {
                           "durationUsec" : 1409,
                           "name" : "DAO_DETAILS:TagSqlDao (raw): getByAccountRecordId"
                        }
                     ],
                     "durationUsec" : 1412,
                     "name" : "DAO:TagSqlDao: getByAccountRecordId"
                  },
                  {
                     "durationUsec" : 29,
                     "name" : "DAO_CONNECTION:get"
                  },
                  {
                     "calls" : [
                        {
                           "durationUsec" : 2414,
                           "name" : "DAO_DETAILS:InvoiceSqlDao (raw): getByAccountRecordId"
                        }
                     ],
                     "durationUsec" : 2415,
                     "name" : "DAO:InvoiceSqlDao: getByAccountRecordId"
                  },
                  {
                     "calls" : [
                        {
                           "durationUsec" : 3304,
                           "name" : "DAO_DETAILS:InvoiceItemSqlDao (raw): getInvoiceItemsForInvoices"
                        }
                     ],
                     "durationUsec" : 3304,
                     "name" : "DAO:InvoiceItemSqlDao: getInvoiceItemsForInvoices"
                  },
                  {
                     "calls" : [
                        {
                           "durationUsec" : 1289,
                           "name" : "DAO_DETAILS:InvoicePaymentSqlDao (raw): getPaymentsForInvoices"
                        }
                     ],
                     "durationUsec" : 1290,
                     "name" : "DAO:InvoicePaymentSqlDao: getPaymentsForInvoices"
                  },
                  {
                     "calls" : [
                        {
                           "durationUsec" : 939,
                           "name" : "DAO_DETAILS:InvoiceTrackingSqlDao (raw): getTrackingsForInvoices"
                        }
                     ],
                     "durationUsec" : 940,
                     "name" : "DAO:InvoiceTrackingSqlDao: getTrackingsForInvoices"
                  },
                  {
                     "calls" : [
                        {
                           "durationUsec" : 1458,
                           "name" : "DAO_DETAILS:InvoiceItemSqlDao (raw): getRepairMap"
                        }
                     ],
                     "durationUsec" : 1460,
                     "name" : "DAO:InvoiceItemSqlDao: getRepairMap"
                  },
                  {
                     "calls" : [
                        {
                           "durationUsec" : 762,
                           "name" : "DAO_DETAILS:InvoiceParentChildrenSqlDao (raw): getParentChildMappingsByChildInvoiceIds"
                        }
                     ],
                     "durationUsec" : 763,
                     "name" : "DAO:InvoiceParentChildrenSqlDao: getParentChildMappingsByChildInvoiceIds"
                  }
               ],
               "durationUsec" : 16855,
               "name" : "API:getInvoicesByAccount"
            },
            {
               "durationUsec" : 51,
               "name" : "API:getAccountAuditLogs"
            }
         ],
         "durationUsec" : 20899,
         "name" : "JAXRS:1.0/kb/accounts/edb71b96-522c-4070-b4ad-7bc0078cc5ef/invoices"
      }
   ]
}

A sample Invoice what is seen in KAUI and what is in the response of the API is attached for reference.

invoice_kaui.png

invoice_api_response.png

because of this issue, as a workaround we are making this call for each invoice.
/accounts/{accountId}/invoicePayments

But this is impacting the performance. If we need to follow this approach then there should be option to exclude payment details in the /accounts/{accountId}/invoices API when includeInvoiceComponents is true, becuase from the call stack above more time is taken in getting the payment details, but the same is not available in the response. 

Looks like this is a bug.

What is the solution to this problem?

Thanks
Vivek

Reshma Bidikar

unread,
Jun 20, 2024, 8:03:01 AMJun 20
to Kill Bill users mailing-list
Hello Vivek,

This does indeed look like a bug. Let me discuss this internally, I'll get back to you.

Regards,
Reshma

Reshma Bidikar

unread,
Jun 20, 2024, 10:54:05 PMJun 20
to Kill Bill users mailing-list
Hello Vivek,

I have now filed a ticket for this issue, you can track it at  https://github.com/killbill/killbill/issues/2030.

Regards,
Reshma

vivek rao

unread,
Jun 20, 2024, 11:03:40 PMJun 20
to Kill Bill users mailing-list
Is this confirmed as a bug? When can we expect the fix for it?

Reshma Bidikar

unread,
Jun 21, 2024, 1:38:35 AMJun 21
to Kill Bill users mailing-list
Hello Vivek,

Yes, it is a bug. Sorry, but we do not have an ETA as of now.

Regards,
Reshma.

vivek rao

unread,
Jun 21, 2024, 3:55:44 AMJun 21
to Kill Bill users mailing-list
Is it possible for you to guide us which files or methods this issue is happening...we will try to see if the fix can be done by ourselves.
From the flow it looks like payment details of the invoice is getting fetched from DB but is not getting copied into the response of the API.

Reshma Bidikar

unread,
Jun 21, 2024, 5:16:33 AMJun 21
to Kill Bill users mailing-list
Hello Vivek,

I discussed this internally. This is an API change and would require a major KB release.  For now, could you use the Retrieve payments associated with an invoice endpoint? 

Regards,
Reshma

vivek rao

unread,
Jun 21, 2024, 5:37:36 AMJun 21
to Kill Bill users mailing-list
Oh :-(

In our system's UI we display all the invoices including its item details and associated payment details of one whole year.

Because of this now we are calling 
/accounts/{accountId}/invoices with includeInvoiceComponents=true
followed by 
currently we are using the same Retrieve payments associated with an invoice.
and then map the payments to invoice IDs
and send this response to our frontend.

This whole operation is taking very long time(about 8 to 10seconds). This is giving a very bad user experience.

Our UI we cannot change as we are only changing the backend billing system, without impact to the frontend of our system

Regards
Vivek

vivek rao

unread,
Jun 24, 2024, 12:36:01 AM (12 days ago) Jun 24
to Kill Bill users mailing-list
Hello,

Please let us know what is the reason for the API being very slow and how to fix it. Sometimes this time is also 8 to 10 seconds.
With this kind of response time we will not be able to take Killbill to our production. This is a blocker for us now.

This is the profiling response for the API with different query params.

curl -v --location 'http://killbill-stage.sequoia-internal.com/1.0/kb/accounts/403e4369-1fe7-4c3e-a297-062f731d0e85/invoicePayments?withPluginInfo=true&withAttempts=true' \
> --header 'X-Killbill-ApiKey: MUR0185' \
> --header 'X-Killbill-ApiSecret: MUR0185' \
> --header 'Accept: application/json' \
> --header 'Authorization: Basic YWRtaW46cGFzc3dvcmQ=' \
> --header 'X-Killbill-Profiling-Req: JAXRS,API,DAO,DAO_DETAILS,DAO_CONNECTION,GLOCK'

{
  "rawData": [
    {
      "name": "JAXRS:1.0/kb/accounts/403e4369-1fe7-4c3e-a297-062f731d0e85/invoicePayments",
      "durationUsec": 3498068,
      "calls": [
        {
          "name": "API:getAccountById",
          "durationUsec": 96162,
          "calls": [
            {
              "name": "DAO_DETAILS:NonEntityDao (type = ACCOUNT) cache miss",
              "durationUsec": 2577,
              "calls": [
                {
                  "name": "DAO_CONNECTION:get",
                  "durationUsec": 439
                }
              ]
            },
            {
              "name": "DAO_DETAILS:NonEntityDao (type = ACCOUNT) cache miss",
              "durationUsec": 1361,
              "calls": [
                {
                  "name": "DAO_CONNECTION:get",
                  "durationUsec": 96
                }
              ]
            },
            {
              "name": "DAO_CONNECTION:get",
              "durationUsec": 177
            },
            {
              "name": "DAO:AccountSqlDao: getByRecordId",
              "durationUsec": 68164,
              "calls": [
                {
                  "name": "DAO_DETAILS:AccountSqlDao (raw): getByRecordId",
                  "durationUsec": 68152
                }
              ]
            },
            {
              "name": "API:getAccountById",
              "durationUsec": 19794,
              "calls": [
                {
                  "name": "DAO_DETAILS:NonEntityDao (type = ACCOUNT) cache miss",
                  "durationUsec": 5590,
                  "calls": [
                    {
                      "name": "DAO_CONNECTION:get",
                      "durationUsec": 190
                    }
                  ]
                },
                {
                  "name": "API:getAccountByRecordIdInternal",
                  "durationUsec": 12565,
                  "calls": [
                    {
                      "name": "DAO_CONNECTION:get",
                      "durationUsec": 162
                    },
                    {
                      "name": "DAO:AccountSqlDao: getByRecordId",
                      "durationUsec": 3144,
                      "calls": [
                        {
                          "name": "DAO_DETAILS:AccountSqlDao (raw): getByRecordId",
                          "durationUsec": 3132
                        }
                      ]
                    }
                  ]
                }
              ]
            }
          ]
        },
        {
          "name": "API:getAccountPayments",
          "durationUsec": 2903458,
          "calls": [
            {
              "name": "DAO_CONNECTION:get",
              "durationUsec": 106
            },
            {
              "name": "DAO:PaymentSqlDao: getByAccountRecordId",
              "durationUsec": 107624,
              "calls": [
                {
                  "name": "DAO_DETAILS:PaymentSqlDao (raw): getByAccountRecordId",
                  "durationUsec": 107611
                }
              ]
            },
            {
              "name": "DAO_CONNECTION:get",
              "durationUsec": 69
            },
            {
              "name": "DAO:TransactionSqlDao: getByAccountRecordId",
              "durationUsec": 96928,
              "calls": [
                {
                  "name": "DAO_DETAILS:TransactionSqlDao (raw): getByAccountRecordId",
                  "durationUsec": 96910
                }
              ]
            },
            {
              "name": "DAO_CONNECTION:get",
              "durationUsec": 230
            },
            {
              "name": "DAO:PaymentMethodSqlDao: getPaymentMethodIncludedDelete",
              "durationUsec": 173589,
              "calls": [
                {
                  "name": "DAO_DETAILS:PaymentMethodSqlDao (raw): getPaymentMethodIncludedDelete",
                  "durationUsec": 173548
                }
              ]
            },
            {
              "name": "API:getTenantValuesForKey",
              "durationUsec": 12962,
              "calls": [
                {
                  "name": "DAO_CONNECTION:get",
                  "durationUsec": 438
                },
                {
                  "name": "DAO:TenantKVSqlDao: getTenantValueForKey",
                  "durationUsec": 8683,
                  "calls": [
                    {
                      "name": "DAO_DETAILS:TenantKVSqlDao (raw): getTenantValueForKey",
                      "durationUsec": 8672
                    }
                  ]
                }
              ]
            },
            {
              "name": "DAO_CONNECTION:get",
              "durationUsec": 203
            },
            {
              "name": "DAO:TransactionSqlDao: getById",
              "durationUsec": 3030,
              "calls": [
                {
                  "name": "DAO_DETAILS:TransactionSqlDao (raw): getById",
                  "durationUsec": 2997
                }
              ]
            },
            {
              "name": "DAO_CONNECTION:get",
              "durationUsec": 78
            },
            {
              "name": "DAO:PaymentAttemptSqlDao: getById",
              "durationUsec": 111991,
              "calls": [
                {
                  "name": "DAO_DETAILS:PaymentAttemptSqlDao (raw): getById",
                  "durationUsec": 111976
                }
              ]
            },
            {
              "name": "DAO_CONNECTION:get",
              "durationUsec": 122
            },
            {
              "name": "DAO:PaymentAttemptSqlDao: getByPaymentExternalKey",
              "durationUsec": 2469,
              "calls": [
                {
                  "name": "DAO_DETAILS:PaymentAttemptSqlDao (raw): getByPaymentExternalKey",
                  "durationUsec": 2405
                }
              ]
            },
            {
              "name": "DAO:DAO:NotificationSqlDao:getReadyQueueEntriesForSearchKeys",
              "durationUsec": 4
            },
            {
              "name": "DAO_CONNECTION:get",
              "durationUsec": 234
            }
          ]
        },
        {
          "name": "API:getInvoicePaymentsByAccount",
          "durationUsec": 374275,
          "calls": [
            {
              "name": "DAO_CONNECTION:get",
              "durationUsec": 105
            },
            {
              "name": "DAO:InvoicePaymentSqlDao: getByAccountRecordId",
              "durationUsec": 184310,
              "calls": [
                {
                  "name": "DAO_DETAILS:InvoicePaymentSqlDao (raw): getByAccountRecordId",
                  "durationUsec": 184294
                }
              ]
            }
          ]
        },
        {
          "name": "API:getAccountAuditLogs",
          "durationUsec": 223
        }
      ]
    }
  ]
}


curl -v --location 'http://killbill-stage.sequoia-internal.com/1.0/kb/accounts/403e4369-1fe7-4c3e-a297-062f731d0e85/invoicePayments?withAttempts=true' \
--header 'X-Killbill-ApiKey: MUR0185' \
--header 'X-Killbill-ApiSecret: MUR0185' \
--header 'Accept: application/json' \
--header 'Authorization: Basic YWRtaW46cGFzc3dvcmQ=' \
--header 'X-Killbill-Profiling-Req: JAXRS,API,DAO,DAO_DETAILS,DAO_CONNECTION,GLOCK'

{
  "rawData": [
    {
      "name": "JAXRS:1.0/kb/accounts/403e4369-1fe7-4c3e-a297-062f731d0e85/invoicePayments",
      "durationUsec": 2921288,
      "calls": [
        {
          "name": "API:getAccountById",
          "durationUsec": 663974,
          "calls": [
            {
              "name": "DAO_DETAILS:NonEntityDao (type = ACCOUNT) cache miss",
              "durationUsec": 47150,
              "calls": [
                {
                  "name": "DAO_CONNECTION:get",
                  "durationUsec": 7727
                }
              ]
            },
            {
              "name": "DAO_DETAILS:NonEntityDao (type = ACCOUNT) cache miss",
              "durationUsec": 2686,
              "calls": [
                {
                  "name": "DAO_CONNECTION:get",
                  "durationUsec": 142
                }
              ]
            },
            {
              "name": "DAO_CONNECTION:get",
              "durationUsec": 251
            },
            {
              "name": "DAO:AccountSqlDao: getByRecordId",
              "durationUsec": 293715,
              "calls": [
                {
                  "name": "DAO_DETAILS:AccountSqlDao (raw): getByRecordId",
                  "durationUsec": 293672
                }
              ]
            },
            {
              "name": "API:getAccountById",
              "durationUsec": 17774,
              "calls": [
                {
                  "name": "DAO_DETAILS:NonEntityDao (type = ACCOUNT) cache miss",
                  "durationUsec": 2207,
                  "calls": [
                    {
                      "name": "DAO_CONNECTION:get",
                      "durationUsec": 145
                    }
                  ]
                },
                {
                  "name": "API:getAccountByRecordIdInternal",
                  "durationUsec": 15023,
                  "calls": [
                    {
                      "name": "DAO_CONNECTION:get",
                      "durationUsec": 132
                    },
                    {
                      "name": "DAO:AccountSqlDao: getByRecordId",
                      "durationUsec": 8384,
                      "calls": [
                        {
                          "name": "DAO_DETAILS:AccountSqlDao (raw): getByRecordId",
                          "durationUsec": 8372
                        }
                      ]
                    }
                  ]
                }
              ]
            }
          ]
        },
        {
          "name": "API:getAccountPayments",
          "durationUsec": 1813185,
          "calls": [
            {
              "name": "DAO_CONNECTION:get",
              "durationUsec": 134
            },
            {
              "name": "DAO:PaymentSqlDao: getByAccountRecordId",
              "durationUsec": 310138,
              "calls": [
                {
                  "name": "DAO_DETAILS:PaymentSqlDao (raw): getByAccountRecordId",
                  "durationUsec": 310101
                }
              ]
            },
            {
              "name": "DAO_CONNECTION:get",
              "durationUsec": 127
            },
            {
              "name": "DAO:TransactionSqlDao: getByAccountRecordId",
              "durationUsec": 194998,
              "calls": [
                {
                  "name": "DAO_DETAILS:TransactionSqlDao (raw): getByAccountRecordId",
                  "durationUsec": 194980
                }
              ]
            },
            {
              "name": "DAO_CONNECTION:get",
              "durationUsec": 156
            },
            {
              "name": "DAO:PaymentAttemptSqlDao: getByPaymentExternalKey",
              "durationUsec": 154207,
              "calls": [
                {
                  "name": "DAO_DETAILS:PaymentAttemptSqlDao (raw): getByPaymentExternalKey",
                  "durationUsec": 154144
                }
              ]
            },
            {
              "name": "DAO:DAO:NotificationSqlDao:getReadyQueueEntriesForSearchKeys",
              "durationUsec": 3743
            },
            {
              "name": "DAO_CONNECTION:get",
              "durationUsec": 172
            }
          ]
        },
        {
          "name": "API:getInvoicePaymentsByAccount",
          "durationUsec": 362476,
          "calls": [
            {
              "name": "DAO_CONNECTION:get",
              "durationUsec": 369
            },
            {
              "name": "DAO:InvoicePaymentSqlDao: getByAccountRecordId",
              "durationUsec": 154862,
              "calls": [
                {
                  "name": "DAO_DETAILS:InvoicePaymentSqlDao (raw): getByAccountRecordId",
                  "durationUsec": 154848
                }
              ]
            }
          ]
        },
        {
          "name": "API:getAccountAuditLogs",
          "durationUsec": 241
        }
      ]
    }
  ]
}


curl -v --location 'http://killbill-stage.sequoia-internal.com/1.0/kb/accounts/403e4369-1fe7-4c3e-a297-062f731d0e85/invoicePayments?withPluginInfo=true' \
--header 'X-Killbill-ApiKey: MUR0185' \
--header 'X-Killbill-ApiSecret: MUR0185' \
--header 'Accept: application/json' \
--header 'Authorization: Basic YWRtaW46cGFzc3dvcmQ=' \
--header 'X-Killbill-Profiling-Req: JAXRS,API,DAO,DAO_DETAILS,DAO_CONNECTION,GLOCK'

{
  "rawData": [
    {
      "name": "JAXRS:1.0/kb/accounts/403e4369-1fe7-4c3e-a297-062f731d0e85/invoicePayments",
      "durationUsec": 190090,
      "calls": [
        {
          "name": "API:getAccountById",
          "durationUsec": 82310,
          "calls": [
            {
              "name": "API:getAccountById",
              "durationUsec": 82213,
              "calls": [
                {
                  "name": "API:getAccountByRecordIdInternal",
                  "durationUsec": 82092,
                  "calls": [
                    {
                      "name": "DAO_CONNECTION:get",
                      "durationUsec": 72724
                    },
                    {
                      "name": "DAO:AccountSqlDao: getByRecordId",
                      "durationUsec": 5119,
                      "calls": [
                        {
                          "name": "DAO_DETAILS:AccountSqlDao (raw): getByRecordId",
                          "durationUsec": 5108
                        }
                      ]
                    }
                  ]
                }
              ]
            }
          ]
        },
        {
          "name": "API:getAccountPayments",
          "durationUsec": 99902,
          "calls": [
            {
              "name": "DAO_CONNECTION:get",
              "durationUsec": 110
            },
            {
              "name": "DAO:PaymentSqlDao: getByAccountRecordId",
              "durationUsec": 1190,
              "calls": [
                {
                  "name": "DAO_DETAILS:PaymentSqlDao (raw): getByAccountRecordId",
                  "durationUsec": 1180
                }
              ]
            },
            {
              "name": "DAO_CONNECTION:get",
              "durationUsec": 241
            },
            {
              "name": "DAO:TransactionSqlDao: getByAccountRecordId",
              "durationUsec": 5321,
              "calls": [
                {
                  "name": "DAO_DETAILS:TransactionSqlDao (raw): getByAccountRecordId",
                  "durationUsec": 5312
                }
              ]
            },
            {
              "name": "DAO_CONNECTION:get",
              "durationUsec": 126
            },
            {
              "name": "DAO:PaymentMethodSqlDao: getPaymentMethodIncludedDelete",
              "durationUsec": 5446,
              "calls": [
                {
                  "name": "DAO_DETAILS:PaymentMethodSqlDao (raw): getPaymentMethodIncludedDelete",
                  "durationUsec": 5437
                }
              ]
            },
            {
              "name": "DAO_CONNECTION:get",
              "durationUsec": 142
            },
            {
              "name": "DAO:TransactionSqlDao: getById",
              "durationUsec": 1387,
              "calls": [
                {
                  "name": "DAO_DETAILS:TransactionSqlDao (raw): getById",
                  "durationUsec": 1380
                }
              ]
            },
            {
              "name": "DAO_CONNECTION:get",
              "durationUsec": 390
            },
            {
              "name": "DAO:PaymentAttemptSqlDao: getById",
              "durationUsec": 1346,
              "calls": [
                {
                  "name": "DAO_DETAILS:PaymentAttemptSqlDao (raw): getById",
                  "durationUsec": 1337
                }
              ]
            }
          ]
        },
        {
          "name": "API:getInvoicePaymentsByAccount",
          "durationUsec": 4156,
          "calls": [
            {
              "name": "DAO_CONNECTION:get",
              "durationUsec": 110
            },
            {
              "name": "DAO:InvoicePaymentSqlDao: getByAccountRecordId",
              "durationUsec": 937,
              "calls": [
                {
                  "name": "DAO_DETAILS:InvoicePaymentSqlDao (raw): getByAccountRecordId",
                  "durationUsec": 929
                }
              ]
            }
          ]
        },
        {
          "name": "API:getAccountAuditLogs",
          "durationUsec": 11
        }
      ]
    }
  ]
}


curl -v --location 'http://killbill-stage.sequoia-internal.com/1.0/kb/accounts/403e4369-1fe7-4c3e-a297-062f731d0e85/invoicePayments' \
--header 'X-Killbill-ApiKey: MUR0185' \
--header 'X-Killbill-ApiSecret: MUR0185' \
--header 'Accept: application/json' \
--header 'Authorization: Basic YWRtaW46cGFzc3dvcmQ=' \
--header 'X-Killbill-Profiling-Req: JAXRS,API,DAO,DAO_DETAILS,DAO_CONNECTION,GLOCK'

{
  "rawData": [
    {
      "name": "JAXRS:1.0/kb/accounts/403e4369-1fe7-4c3e-a297-062f731d0e85/invoicePayments",
      "durationUsec": 25519,
      "calls": [
        {
          "name": "API:getAccountById",
          "durationUsec": 6753,
          "calls": [
            {
              "name": "API:getAccountById",
              "durationUsec": 6456,
              "calls": [
                {
                  "name": "API:getAccountByRecordIdInternal",
                  "durationUsec": 6324,
                  "calls": [
                    {
                      "name": "DAO_CONNECTION:get",
                      "durationUsec": 1173
                    },
                    {
                      "name": "DAO:AccountSqlDao: getByRecordId",
                      "durationUsec": 2272,
                      "calls": [
                        {
                          "name": "DAO_DETAILS:AccountSqlDao (raw): getByRecordId",
                          "durationUsec": 2264
                        }
                      ]
                    }
                  ]
                }
              ]
            }
          ]
        },
        {
          "name": "API:getAccountPayments",
          "durationUsec": 11263,
          "calls": [
            {
              "name": "DAO_CONNECTION:get",
              "durationUsec": 102
            },
            {
              "name": "DAO:PaymentSqlDao: getByAccountRecordId",
              "durationUsec": 2047,
              "calls": [
                {
                  "name": "DAO_DETAILS:PaymentSqlDao (raw): getByAccountRecordId",
                  "durationUsec": 2039
                }
              ]
            },
            {
              "name": "DAO_CONNECTION:get",
              "durationUsec": 206
            },
            {
              "name": "DAO:TransactionSqlDao: getByAccountRecordId",
              "durationUsec": 2354,
              "calls": [
                {
                  "name": "DAO_DETAILS:TransactionSqlDao (raw): getByAccountRecordId",
                  "durationUsec": 2345
                }
              ]
            }
          ]
        },
        {
          "name": "API:getInvoicePaymentsByAccount",
          "durationUsec": 5771,
          "calls": [
            {
              "name": "DAO_CONNECTION:get",
              "durationUsec": 133
            },
            {
              "name": "DAO:InvoicePaymentSqlDao: getByAccountRecordId",
              "durationUsec": 2363,
              "calls": [
                {
                  "name": "DAO_DETAILS:InvoicePaymentSqlDao (raw): getByAccountRecordId",
                  "durationUsec": 2334
                }
              ]
            }
          ]
        },
        {
          "name": "API:getAccountAuditLogs",
          "durationUsec": 9
        }
      ]
    }
  ]
}

karan bansal

unread,
Jun 24, 2024, 1:17:22 PM (12 days ago) Jun 24
to Kill Bill users mailing-list
Hi Vivek,

Could you check the property org.killbill.security.shiroNbHashIterations/ KB_org_killbill_security_shiroNbHashIterations, docs link here and run your test with a lower value of this parameter. Let me know if you notice any change in performance.

Regards
Karan

stephane brossier

unread,
Jun 24, 2024, 6:38:26 PM (12 days ago) Jun 24
to vivek rao, Kill Bill users mailing-list
If you don't specify 'withPluginInfo=true', is it still slow? 

--
You received this message because you are subscribed to the Google Groups "Kill Bill users mailing-list" group.
To unsubscribe from this group and stop receiving emails from it, send an email to killbilling-us...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/killbilling-users/ba3f208f-f902-4ace-a689-d73c5c44f530n%40googlegroups.com.

vivek rao

unread,
Jun 24, 2024, 9:48:44 PM (11 days ago) Jun 24
to Kill Bill users mailing-list
Hello Stephane

If I don't specify 'withPluginInfo=true', it is not slow, it is reasonable.

Note : When the below curls are executed, KB Account has only one Invoice of 1st and June and its Payment.

Including both withPluginInfo=true and withPluginInfo=true. -  Very Slow
image (3).png

Only withPluginInfo= true.  -  Very Slow
image (4).png

only withAttempts=true  - Reasonable
image (5).png

Removing both queryParams. - Looks OK
image (6).png

Thanks
Vivek

vivek rao

unread,
Jun 24, 2024, 9:50:18 PM (11 days ago) Jun 24
to Kill Bill users mailing-list
Hi Karan

Will set org.killbill.security.shiroNbHashIterations/ KB_org_killbill_security_shiroNbHashIterations = 1
and then test and share the results to you.

But are you sure this could be the reason? In the API profiling data there is no mention related to this operation.

Thanks
Vivek

vivek rao

unread,
Jun 26, 2024, 1:56:29 AM (10 days ago) Jun 26
to Kill Bill users mailing-list
Hello Karan

What will be the impact of changing of the value of org.killbill.security.shiroNbHashIterations/ KB_org_killbill_security_shiroNbHashIterations = 1.

After doing this change will all the tenants and accounts which already exists in the KB system work without any impcats, or wii there be any issues in operations related to those existing tenants/accounts? If yes how to fix them?

Thanks
Vivek

vivek rao

unread,
Jun 26, 2024, 2:10:43 AM (10 days ago) Jun 26
to stephane brossier, Kill Bill users mailing-list
Hi Stephane

We are using the stripe as the payment plugin.
This is taken from the Killbill git repo killbill-stripe-plugin.

Also why would this API try to make calls to the payment gateway? In that case we can never integrate this API with our frontend as this delay will impact the user experience.

I see that KB DB has many tables related to the payments, so isn't the Payment for the invoice triggered post the invoice generation and followed by persisting all the payment related details in the KB DB? If this is the flow why would /invoicePayment API call Payment gateway?
This is a paginated API, does that mean for each invoice which is expected in the response one call to payment gateway will be made?

Currently in my data set I had only one invoice for which payment is done. This was taking around 8s to 10s. If there are more invoices in the response then for each of them one call to payment gateway will result is extremely poor performance.

Thanks
Vivek


On Wed, Jun 26, 2024 at 7:03 AM stephane brossier <step...@kill-bill.org> wrote:
If this slow 'withPluginInfo=true',  I suspect this is because some calls are delegated to the payment plugin - and potentially there are calls made to the payment gateway which typically can be very slow. I am not sure which payment plugin you are using but I would suggest to debug what the call is doing inside the plugin to troubleshoot this.


stephane brossier

unread,
Jun 26, 2024, 3:29:59 AM (10 days ago) Jun 26
to vivek rao, Kill Bill users mailing-list
If this slow 'withPluginInfo=true',  I suspect this is because some calls are delegated to the payment plugin - and potentially there are calls made to the payment gateway which typically can be very slow. I am not sure which payment plugin you are using but I would suggest to debug what the call is doing inside the plugin to troubleshoot this.


vivek rao

unread,
Jun 26, 2024, 8:33:51 AM (10 days ago) Jun 26
to Kill Bill users mailing-list
Hello Karan

I tried changing the value of org.killbill.security.shiroNbHashIterations/ KB_org_killbill_security_shiroNbHashIterations to 1 to do the testst.
But after changing this, when I click on Account Listing it is giving error.

I see some FATAL errors in KAUI when Listing Accounts.
Looks like we cannot operate on the same tenant/account if shiroNbHashIterations value is changed.
However if new tenant and account is created those operations are ok.
Could you please find a solution for this problem, if there exists a solution then I will attempt this again. This way I need not create the data set again from  begining.

Hence we are reverting the value back to the default one, so that our functional tests are not blocked.

list_account.png

kaui_fatal_log.png

Thanks
Vivek

karan bansal

unread,
Jun 26, 2024, 1:26:53 PM (10 days ago) Jun 26
to Kill Bill users mailing-list
Hi Vivek,

Please refer to the point about adjusting org.killbill.security.shiroNbHashIterations here

Regards
Karan

vivek rao

unread,
Jul 1, 2024, 8:13:41 AM (5 days ago) Jul 1
to Kill Bill users mailing-list
Hi Stephane

Any update on this issue?
Because of this issue our plan of going to production is on hold. 
Because this is going to affect the user experience 
very badly. 

Thanks
Vivek

karan bansal

unread,
Jul 2, 2024, 12:51:42 PM (4 days ago) Jul 2
to Kill Bill users mailing-list
Hi Vivek,

Were you able to follow the above link that I shared about how to change the iterations value and test the outcome/time response?

Regards
Karan

Reply all
Reply to author
Forward
0 new messages