Skip to content

reactor: Deprecate add_task/add_urgent_task/add_high_priority_task#3341

Draft
xemul wants to merge 1 commit into
scylladb:masterfrom
xemul:br-reactor-task-management-low-level-public-deprecate
Draft

reactor: Deprecate add_task/add_urgent_task/add_high_priority_task#3341
xemul wants to merge 1 commit into
scylladb:masterfrom
xemul:br-reactor-task-management-low-level-public-deprecate

Conversation

@xemul

@xemul xemul commented Apr 2, 2026

Copy link
Copy Markdown
Contributor

These methods may have out-of-tree users and cannot be simply removed, but they should not be part of the public reactor API going forward. Deprecate them in favor of the seastar::schedule() and seastar::schedule_urgent() free functions.

Internal call sites in reactor.cc are wrapped with diagnostic pragmas to suppress the deprecation warnings. add_high_priority_task() is additionally exposed via reactor::test::add_high_priority_task() to prepare for the eventual privatization of the method, with the pragma applied there so test code remains clean.

These methods may have out-of-tree users and cannot be simply removed,
but they should not be part of the public reactor API going forward.
Deprecate them in favor of the seastar::schedule() and
seastar::schedule_urgent() free functions.

Internal call sites in reactor.cc are wrapped with diagnostic pragmas
to suppress the deprecation warnings. add_high_priority_task() is
additionally exposed via reactor::test::add_high_priority_task() to
prepare for the eventual privatization of the method, with the pragma
applied there so test code remains clean.

Signed-off-by: Pavel Emelyanov <xemul@scylladb.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@xemul

xemul commented Apr 15, 2026

Copy link
Copy Markdown
Contributor Author

@scylladb/seastar-maint , please review

Comment thread src/core/reactor.cc
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
add_high_priority_task(make_task(default_scheduling_group(), [fn = std::move(reclaim_fn)] {
fn();
}));

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Seastar code shouldn't use deprecated declarations.

Once we deprecate something, from Seastar's persepective, it's ready to be removed at any time.

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.

The goal is not to remove those methods, but move them to private eventually and "undeprecated" them back.

To follow the suggestion not to use deprecated symbols, there must appear add_high_priority_task_private() method, the add_high_priority_task() (now deprecated) should call it, and after deprecation quiscent timeout we'll need to rename add_...private() back into add...() one. Does it worth it?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@xemul maybe add corresponding seastar::internal entry points that would be called from the public entry points that are deprecated in this path, and change the library calls to use the internal entry points also in this patch.

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.

And mark those entry points as friends? I'll try to re-structure it somehow else

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.

Seems fine to me to delay that restructure/decision to the removal point?

@xemul xemul marked this pull request as draft May 6, 2026 10:19
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.

4 participants