Skip to content

OAK-8633: Add warn logs if we add/update a string property larger than 100KB (Node)#155

Closed
tihom88 wants to merge 4 commits intoapache:trunkfrom
tihom88:OAK-8633_v2
Closed

OAK-8633: Add warn logs if we add/update a string property larger than 100KB (Node)#155
tihom88 wants to merge 4 commits intoapache:trunkfrom
tihom88:OAK-8633_v2

Conversation

@tihom88
Copy link
Copy Markdown
Contributor

@tihom88 tihom88 commented Sep 29, 2019

No description provided.

int threshold = OakJcrConstants.DEFAULT_WARN_LOG_STRING_SIZE_THRESHOLD_VALUE;
if (System.getProperty(OakJcrConstants.WARN_LOG_STRING_SIZE_THRESHOLD_KEY) != null
&& !System.getProperty(OakJcrConstants.WARN_LOG_STRING_SIZE_THRESHOLD_KEY).isEmpty()) {
threshold = Integer.parseInt(System.getProperty(OakJcrConstants.WARN_LOG_STRING_SIZE_THRESHOLD_KEY));
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Integer#parseInt can throw NumberFormatException which should be caught an handled. But, better yet, it would cleaner to simply use Integer#getInt(String, int).

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

package org.apache.jackrabbit.oak.jcr.session;

public interface OakJcrConstants {
int DEFAULT_WARN_LOG_STRING_SIZE_THRESHOLD_VALUE = 102400;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't recall our earlier discussion, but I though we were saying that indexing end (OAK-8642) would log for 100K while jcr side would be a bit more tolerable. But maybe, I'm mis-remembering.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AFAIR, two different values were not suggested. If you think we should have different values, let me know what should be default value for jcr.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nah... It's just what I recalled. I'm on both ways.

@tihom88
Copy link
Copy Markdown
Contributor Author

tihom88 commented Oct 4, 2019

Changes merged in trunk. Closing this PR

@tihom88 tihom88 closed this Oct 4, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants