apple / apple/foundationdb

Simulated tests should simulate file operations that complete synchronously

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

Description

There are some real-world file operations that are able to complete synchronously. For example, opening a (non-existent?) file can complete without any waits.

There was a recent bug (fixed by #4900) introduced into a code path that only gets exercised when files are open synchronously, and it is therefore not detected in simulation.

There are some waits that are straightforward to address, but one in particular is a bit tricky. In various places, we require that the simulator switches process contexts to the machine context and back to the process. The act of switching requires a delay, and that prevents us from being synchronous.

See for example the calls to `onMachine` and `onProcess` here:

https://github.com/apple/foundationdb/blob/eb9cce6351ee0bf7024aa20b2fa7fd45966443aa/fdbrpc/AsyncFileNonDurable.actor.h#L223

Contributor guide

Open the contributing guide

Research direction

Start by reading fdbrpc/AsyncFileNonDurable.actor.h around the calls to onMachine and onProcess, then review the bug fixed by #4900. Determine how the simulator can represent file operations that complete synchronously, including the required context switches. Done means simulated synchronous file operations exercise the affected code paths without incorrectly introducing waits.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
distributed-systems, testing
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.