question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[QUESTION] ExceededMaxResultBufferException on a big transaction with maxResultBuffer property applied

See original GitHub issue

Question

I’m trying to understand behavior of the maxResultBuffer connection property.

Setup: Debezium Server is used to stream transactions from a source MSSQL Database to a downstream system.

Given: when there is a “big” transaction (for example, many rows are inserted in a single transaction), the process fails with an OOM error. My assumption was that if I apply maxResultBuffer connection string property, my “big” transaction would be split up into chunks of size equal or less than the maxResultBuffer and chunks will be processed one by one. This will ultimately save me from the OOM.

Instead, when the transaction is executed, the process first gets the “MaxResultBuffer property exceeded…” log error and then fails with the “com.microsoft.sqlserver.jdbc.SQLServerException” “The TDS protocol stream is not valid.”.

Is it an expected behavior to get an exception when the MaxResultBuffer value is exceeded and how should it be handled?

Relevant Issues and Pull Requests

maxResultBuffer doc: https://learn.microsoft.com/en-us/sql/connect/jdbc/setting-the-connection-properties?view=sql-server-ver16 maxResultBuffer PR: https://github.com/microsoft/mssql-jdbc/pull/1431

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
artyomdmitrievcommented, Oct 20, 2022

Thanks for an explanation! Closing the topic.

0reactions
Jeffery-Wastycommented, Oct 19, 2022

Thanks. I was able to confirm maxResultBuffer is being used correctly in this case. As for how to handle the actual overflow, it’s not handled by the driver, and expected to be handled somewhere else. maxResultBuffer is only responsible for limiting how much is read. For a Debezium solution you can use max.queue.size and max.queue.size.in.bytes.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Debit Cards Frequently Asked Questions
Answers to frequently asked questions about debit cards. What is a debit card? ... Because the payment is deducted directly from a checking...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found