Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The default capacity of the BatchCommand StringBuilder 10240 might not be sufficient #16487

Closed
gwonen opened this issue Jul 26, 2024 · 3 comments

Comments

@gwonen
Copy link

gwonen commented Jul 26, 2024

Describe the bug

After upgrading a website from Orchard Core 1.7.0 to 1.8.3 I started seeing this recurring warning in my log whenever a content item of a particular content type is loaded. I've traced it back to line 33 (var document = await _session.Query<T>().FirstOrDefaultAsync()) in the DocumentStore class. Nothing seems to break functionally, but it looks a bit ominous.

Orchard Core version

1.8.3

To Reproduce

I have not been able to reproduce the issue in a different environment. The content type in question happens to contain many fields (around 30) over multiple parts. It sounds like its string representation is exceeding the initial size of some internal string builder, which might result in some additional overhead, hence the warning.

Expected behavior

No ominous warnings.

Logs and screenshots

Example log:
2024-07-26 11:44:45.4884|MyTenant|00-adb6d0986e9c637d9ebdc93227339930-c901334b7cbdefc9-00||YesSql|WARN|The default capacity of the BatchCommand StringBuilder 10240 might not be sufficient. It can be increased with BatchCommand.DefaultBuilderCapacity to at least 10679 2024-07-26 11:47:31.9291|MyTenant|00-e1c8602e4153c4993a7548d5e670a0f1-88a79bd627414da4-00||YesSql|WARN|The default capacity of the BatchCommand StringBuilder 10240 might not be sufficient. It can be increased with BatchCommand.DefaultBuilderCapacity to at least 10679 2024-07-26 11:48:51.8397|MyTenant|00-e1c8602e4153c4993a7548d5e670a0f1-88a79bd627414da4-00||YesSql|WARN|The default capacity of the BatchCommand StringBuilder 10240 might not be sufficient. It can be increased with BatchCommand.DefaultBuilderCapacity to at least 10679

@Piedone
Copy link
Member

Piedone commented Jul 26, 2024

This is a warning coming from YesSql. You'll need to do what the log message says, and set a larger value to BatchCommand.DefaultBuilderCapacity. You can do this from e.g. the beginning of your root web project's Program.

What happens if you increase that? Apart from the warning going away, is everything working properly?

However, this value doesn't actually seem to be used anywhere. There is already an issue about it: sebastienros/yessql#572.

@gwonen
Copy link
Author

gwonen commented Jul 29, 2024

Increasing the DefaultBuilderCapacity in OrchardCore.Cms.Web.Program removes the warnings and doesn't seem to have any adverse effects. If it's a known issue and slated for removal from YesSql, I assume this will resolve itself in future versions.

@gwonen gwonen closed this as completed Jul 29, 2024
@Piedone
Copy link
Member

Piedone commented Jul 29, 2024

Yep! Great, then.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants