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

Introduce a plugin API to provide all thread local state, and deprecate stdio-specific methods #15890

Merged
merged 1 commit into from
Jun 23, 2022

Conversation

stuhood
Copy link
Member

@stuhood stuhood commented Jun 22, 2022

As described in #15887: StreamingWorkunit plugins have never been able to set thread-local WorkunitStore state, but that apparently didn't matter until #11331 made it possible for the StreamingWorkunitContext file-fetching methods to encounter data which had not yet been fetched (and thus needed to create a workunit for the fetching).

This change updates and "deprecates" the existing stdio_thread_[gs]et_destination methods (although it doesn't have access to a decorator to do that), and introduces generic thread-local state methods which include all thread-local state required by engine APIs.

Fixes #15887.

[ci skip-build-wheels]

@stuhood stuhood merged commit e6e2703 into pantsbuild:main Jun 23, 2022
@stuhood stuhood deleted the stuhood/swh-thread-local-apis branch June 23, 2022 16:46
stuhood added a commit to stuhood/pants that referenced this pull request Jun 23, 2022
…te stdio-specific methods (pantsbuild#15890)

As described in pantsbuild#15887: `StreamingWorkunit` plugins have never been able to set thread-local `WorkunitStore` state, but that apparently didn't matter until pantsbuild#11331 made it possible for the `StreamingWorkunitContext` file-fetching methods to encounter data which had not yet been fetched (and thus needed to create a workunit for the fetching).

This change updates and "deprecates" the existing `stdio_thread_[gs]et_destination` methods (although it doesn't have access to a decorator to do that), and introduces generic thread-local state methods which include all thread-local state required by engine APIs.

Fixes pantsbuild#15887.

[ci skip-build-wheels]
@stuhood stuhood modified the milestones: 2.12.x, 2.13.x Jun 23, 2022
stuhood added a commit that referenced this pull request Jun 23, 2022
…te stdio-specific methods (Cherry-pick of #15890) (#15907)

As described in #15887: `StreamingWorkunit` plugins have never been able to set thread-local `WorkunitStore` state, but that apparently didn't matter until #11331 made it possible for the `StreamingWorkunitContext` file-fetching methods to encounter data which had not yet been fetched (and thus needed to create a workunit for the fetching).

This change updates and "deprecates" the existing `stdio_thread_[gs]et_destination` methods (although it doesn't have access to a decorator to do that), and introduces generic thread-local state methods which include all thread-local state required by engine APIs.

Fixes #15887.

[ci skip-build-wheels]
@Eric-Arellano
Copy link
Contributor

How do we communicate with plugin authors the deprecation? Given that the Plugin API is not stable, I suppose the changelog + Plugin Upgrade Guide is sufficient.

@stuhood
Copy link
Member Author

stuhood commented Jun 23, 2022

How do we communicate with plugin authors the deprecation? Given that the Plugin API is not stable, I suppose the changelog + Plugin Upgrade Guide is sufficient.

Yea. I also think that StreamingWorkunit plugins are extra super not stable.

stuhood added a commit to stuhood/pants that referenced this pull request Jun 24, 2022
…te stdio-specific methods (pantsbuild#15890)

As described in pantsbuild#15887: `StreamingWorkunit` plugins have never been able to set thread-local `WorkunitStore` state, but that apparently didn't matter until pantsbuild#11331 made it possible for the `StreamingWorkunitContext` file-fetching methods to encounter data which had not yet been fetched (and thus needed to create a workunit for the fetching).

This change updates and "deprecates" the existing `stdio_thread_[gs]et_destination` methods (although it doesn't have access to a decorator to do that), and introduces generic thread-local state methods which include all thread-local state required by engine APIs.

Fixes pantsbuild#15887.

[ci skip-build-wheels]
stuhood added a commit that referenced this pull request Jun 24, 2022
…te stdio-specific methods (Cherry-pick of #15890) (#15916)

As described in #15887: `StreamingWorkunit` plugins have never been able to set thread-local `WorkunitStore` state, but that apparently didn't matter until #11331 made it possible for the `StreamingWorkunitContext` file-fetching methods to encounter data which had not yet been fetched (and thus needed to create a workunit for the fetching).

This change updates and "deprecates" the existing `stdio_thread_[gs]et_destination` methods (although it doesn't have access to a decorator to do that), and introduces generic thread-local state methods which include all thread-local state required by engine APIs.

Fixes #15887.

[ci skip-build-wheels]
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.

Adjust plugin thread-local APIs to account for WorkunitStore state
3 participants