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

[FLINK-37159][runtime] Fix the test timeout by yielding Modifier thread #26003

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

showuon
Copy link
Member

@showuon showuon commented Jan 17, 2025

What is the purpose of the change

Fixing the MemoryManagerConcurrentModReleaseTest.testConcurrentModificationWhileReleasing timeout in AZP.
This test is testing concurrent segment modification while releasing. It creates 10k segments at the beginning and creates an additional thread to keep doing the segment modification, while the main thread is releasing the segments. During the releasing, if the segment is concurrently modified, the ConcurrentModificationException will be thrown and retry. So, this is a non-deterministic test that the concurrent change might happen forever and cause timeout exception.

To fix this issue, we can set a timeout, and after the timeout, we start to lower the priority of the modifier thread to let the release completes soon.

Brief change log

Fix the MemoryManagerConcurrentModReleaseTest.testConcurrentModificationWhileReleasing timeout in AZP.

Verifying this change

This change is already covered by existing tests, such as (please describe tests).

Does this pull request potentially affect one of the following parts:

  • Dependencies (does it add or upgrade a dependency): no
  • The public API, i.e., is any changed class annotated with @Public(Evolving): no
  • The serializers: no
  • The runtime per-record code paths (performance sensitive): no
  • Anything that affects deployment or recovery: JobManager (and its components), Checkpointing, Kubernetes/Yarn, ZooKeeper: no
  • The S3 file system connector: no

Documentation

  • Does this pull request introduce a new feature? no
  • If yes, how is the feature documented? not applicable

@showuon
Copy link
Member Author

showuon commented Jan 17, 2025

@reswqa , please take a look. Thanks.

@showuon showuon force-pushed the FLINK-37159 branch 3 times, most recently from 2434769 to 29b26ad Compare January 17, 2025 09:57
@@ -97,6 +101,12 @@ public void run() {
try {
MemorySegment seg = toModify.remove(0);
toModify.add(seg);
// if the test running time reaches TEST_TIMEOUT_MS, we should lower the
// priority of the Modifier thread to let segment release completes sooner.
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: this code does not lower the thread priority, yield is just a hint to the scheduler that the current thread is willing to yield its current use of a processor.

Copy link
Member Author

Choose a reason for hiding this comment

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

@davidradl , thanks for the comment. I agree yield depends on the OS implementation. I changed to sleep(1) to force yield the CPU resource.

@flinkbot
Copy link
Collaborator

flinkbot commented Jan 17, 2025

CI report:

Bot commands The @flinkbot bot supports the following commands:
  • @flinkbot run azure re-run the last Azure build

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

Successfully merging this pull request may close these issues.

3 participants