apple / apple/foundationdb

Adding thread completion hooks after the network is running should return an error

Open
#345 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
16.7k
Forks
1.6k
Avg merge
1d 20h
Merged PRs (30d)
126

Description

The documentation for `fdb_add_network_thread_completion_hook` says that it must be called prior to running the network, but it doesn't enforce this. Adding hooks after the network is running could lead to races with firing the hooks, which could result in unpredictable behavior. Instead, we should detect and fail to add the completion hook once the network is running.

Contributor guide

Open the contributing guide

Research direction

Start by locating fdb_add_network_thread_completion_hook and the code that tracks whether the network is running. Review the function's documentation and lifecycle checks, then verify that adding a hook after startup reports an error rather than succeeding; add or update coverage if the surrounding tests provide a suitable entry point.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
backend-api-design, distributed-systems
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.