Skip to content

IGNITE-24062 Use throttled logger for heap lock manager #5015

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

Merged
merged 5 commits into from
Jan 11, 2025

Conversation

vldpyatkov
Copy link
Contributor

Copy link
Contributor

@JAkutenshi JAkutenshi left a comment

Choose a reason for hiding this comment

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

Naming and executor usage comments

/** Throttle timeout in milliseconds (value is 5 min). */
long THROTTLE_TIMEOUT_MILLIS = TimeUnit.MINUTES.toMillis(5);
/** JVM property to configure a throttle interval. */
String THROTTLE_TIMEOUT_MILLIS = "IGNITE_THROTTLE_TIMEOUT_MILLIS";
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we provide any user documentation on the property?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I added a release note for this ticket.
Currently, we do not have other options.

Copy link
Contributor

Choose a reason for hiding this comment

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

Also after the slack discussion we consider all system properties as internal details and wouldn't make a documentation.

String THROTTLE_TIMEOUT_MILLIS = "IGNITE_THROTTLE_TIMEOUT_MILLIS";

/** Default throttle timeout in milliseconds (value is 5 min). */
long DEFAULT_THROTTLE_TIMEOUT = TimeUnit.MINUTES.toMillis(5);
Copy link
Contributor

Choose a reason for hiding this comment

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

Also I would like to save MILLIS postfix for the default value and name the property name field:

  1. static final
  2. named as THROTTLE_TIMEOUT_MILLIS_PROPERTY_NAME, it's more verbose, but there is distinct between prop's name and it's value.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

  1. It is an interface. So it has public static final modifiers by default.
  2. I renamed the variable and the property name also. I do not think it is necessary to use the *_PROPERTY_NAME prefix.

Copy link
Contributor

@JAkutenshi JAkutenshi Jan 10, 2025

Choose a reason for hiding this comment

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

  1. My bad.
  2. Up to you, but we have 2 variables DEFAULT_LOG_THROTTLE_INTERVAL_MS and LOG_THROTTLE_INTERVAL_MS where the first one is long and the last one is String, their purposes and actual value are different, that's why I suggested to name a property name in this way.

But still, we have no now any conventions, so it's just my proposal.

private static final IgniteLogger THROTTLED_LOG = Loggers.toThrottledLogger(
Loggers.forClass(HeapLockManager.class),
// TODO: IGNITE-24181 Get rid of Common thread pool.
ForkJoinPool.commonPool()
Copy link
Contributor

Choose a reason for hiding this comment

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

Why ForkJoinPool there? May we pass ThreadPoolsManager#commonScheduler there from IgniteImpl in time? I saw IGNITE-24181, but just thought that common scheduler may be more reasonable for now.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I do not want to drag an executor here because it would be deleted in the mentioned ticket.

Copy link
Contributor

Choose a reason for hiding this comment

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

Up to you, accepted

@vldpyatkov vldpyatkov merged commit bfdfd23 into apache:main Jan 11, 2025
1 check passed
@vldpyatkov vldpyatkov deleted the ignite-24062 branch January 11, 2025 16:14
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.

2 participants