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

Add ScopedJobThreadPtr class to be used with JobThread #4275

Open
wants to merge 1 commit into
base: 25.lts.1+
Choose a base branch
from

Conversation

alexanderbobrovnik
Copy link
Collaborator

@alexanderbobrovnik alexanderbobrovnik commented Oct 17, 2024

b/372515171

@alexanderbobrovnik alexanderbobrovnik changed the title Add explicit join thread to JobThread Add ScopedJobThreadPtr class to be used with JobThread Oct 22, 2024
@xiaomings xiaomings requested a review from borongc October 22, 2024 18:20
@xiaomings
Copy link
Contributor

@borongc is it possible for you to help me review the part in this PR where all changes to Schedule() made during the scoped_ptr<> to unique_ptr<> migration is reverted?

starboard/shared/starboard/player/job_thread.h Outdated Show resolved Hide resolved
starboard/shared/starboard/player/job_thread.h Outdated Show resolved Hide resolved
starboard/shared/starboard/player/job_thread.h Outdated Show resolved Hide resolved
@xiaomings
Copy link
Contributor

@osagie98 @sideb0ard is it possible for you to take a look at this one?

@sideb0ard
Copy link
Contributor

@osagie98 @sideb0ard is it possible for you to take a look at this one?

looking now, re-reading bug history.

Copy link
Contributor

@sideb0ard sideb0ard left a comment

Choose a reason for hiding this comment

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

From reading Xiaoming and Jelle's comments, specifically https://b.corp.google.com/issues/372515171#comment11
this new ScopedJobThreadPtr has the behavior we require in the correct order, i.e. finish jobs, terminate thread, set pointer to null.
However, as this PR and bug are still open, we appear to still have some lingering reservations.

Suggestion:

  • Can we first add a new test to job_thread_test.cc 'ScheduleJobDuringShutdown', which specifically triggers the DCHECK listed in https://b.corp.google.com/issues/372515171#comment1
    This new test should FAIL with the current implementation.
  • Then, secondly, run the new test with this PR, which should PASS. If it does pass, then we can be sure it's solved the issue as we currently understand it.

@alexanderbobrovnik
Copy link
Collaborator Author

From reading Xiaoming and Jelle's comments, specifically https://b.corp.google.com/issues/372515171#comment11 this new ScopedJobThreadPtr has the behavior we require in the correct order, i.e. finish jobs, terminate thread, set pointer to null. However, as this PR and bug are still open, we appear to still have some lingering reservations.

Suggestion:

* Can we first add a new test to job_thread_test.cc 'ScheduleJobDuringShutdown', which specifically triggers the DCHECK listed in https://b.corp.google.com/issues/372515171#comment1
  This new test should FAIL with the current implementation.

* Then, secondly, run the new test with this PR, which should PASS. If it does pass, then we can be sure it's solved the issue as we currently understand it.

I've created PR for ScheduleJobDuringShutdown test: #4864

@sideb0ard
Copy link
Contributor

I've created PR for ScheduleJobDuringShutdown test: #4864

perfect, thank you!
Rather than merge #4864 which breaks the build, as expected:

image

Lets go ahead and add that test to this PR, which should now pass with these changes.

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.

5 participants