Skip to content

Commit caeba8b

Browse files
Merge pull request #13303 from tclinkenbeard-oai/dev/tclinkenbeard/actorcompiler-include-cleanup
Clean up actor compiler includes
2 parents 082ac9f + eec3cd4 commit caeba8b

30 files changed

Lines changed: 22 additions & 48 deletions

documentation/tutorial/make_h2o.actor.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,15 @@
2525
#include "fdbclient/NativeAPI.actor.h"
2626
#include "fdbclient/ReadYourWrites.h"
2727
#include "flow/TLSConfig.h"
28-
#include "flow/actorcompiler.h"
2928

3029
#include <functional>
3130
#include <iostream>
3231
#include <memory>
3332
#include <unordered_map>
3433
#include <vector>
3534

35+
#include "flow/actorcompiler.h"
36+
3637
// Flow solution to https://leetcode.com/problems/building-h2o/
3738
//
3839
// The description of this problem calls for threads running as

documentation/tutorial/play.actor.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,12 @@
2323
#include "flow/flow.h"
2424
#include "flow/Platform.h"
2525
#include "flow/TLSConfig.h"
26-
#include "flow/actorcompiler.h"
2726

2827
#include <iostream>
2928
#include <vector>
3029

30+
#include "flow/actorcompiler.h"
31+
3132
/// Use this file as means to play with flow code
3233
/// The goal is to give you a starting point with a boilerplate template
3334
/// Don't expect frequent changes to this file unless we want to change the base template

documentation/tutorial/play_network.actor.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,12 @@
2323
#include "flow/flow.h"
2424
#include "flow/Platform.h"
2525
#include "flow/TLSConfig.h"
26-
#include "flow/actorcompiler.h"
2726

2827
#include <iostream>
2928
#include <vector>
3029

30+
#include "flow/actorcompiler.h"
31+
3132
/// This file has code similar to play.actor.cpp, but for client/server actors talking over a network
3233
/// It's also similar to tutorial.actor.cpp but only has the minimal code needed for testing client/server actor
3334
/// interactions over the network.
@@ -217,4 +218,4 @@ int main(int argc, char* argv[]) {
217218
g_network->run();
218219

219220
return 0;
220-
}
221+
}

documentation/tutorial/print_in_order.actor.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,15 @@
2525
#include "fdbclient/NativeAPI.actor.h"
2626
#include "fdbclient/ReadYourWrites.h"
2727
#include "flow/TLSConfig.h"
28-
#include "flow/actorcompiler.h"
2928

3029
#include <functional>
3130
#include <iostream>
3231
#include <memory>
3332
#include <unordered_map>
3433
#include <vector>
3534

35+
#include "flow/actorcompiler.h"
36+
3637
// Solution to https://leetcode.com/problems/print-in-order/description/
3738
//
3839
// This is a super basic concurrency exercise useful as a day 1

fdbclient/CoordinationInterface.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,11 @@
2929
#endif
3030
#include "boost/asio.hpp"
3131
#include "fdbclient/CoordinationInterface.h"
32-
#include "flow/actorcompiler.h"
3332

3433
IPAddress ClusterConnectionString::determineLocalSourceIP() const {
3534
int size = coords.size() + hostnames.size();
3635
int index = 0;
37-
loop {
36+
while (true) {
3837
try {
3938
using namespace boost::asio;
4039

fdbclient/GlobalConfig.cpp

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,6 @@
2727
#include "flow/flow.h"
2828
#include "flow/genericactors.actor.h"
2929

30-
#include "flow/actorcompiler.h" // This must be the last #include.
31-
3230
const KeyRef fdbClientInfoTxnSampleRate = "config/fdb_client_info/client_txn_sample_rate"_sr;
3331
const KeyRef fdbClientInfoTxnSizeLimit = "config/fdb_client_info/client_txn_size_limit"_sr;
3432

@@ -159,7 +157,7 @@ Future<Version> GlobalConfig::refresh(Version lastKnown, Version largestSeen) {
159157
erase(KeyRangeRef(""_sr, "\xff"_sr));
160158

161159
Backoff backoff(CLIENT_KNOBS->GLOBAL_CONFIG_REFRESH_BACKOFF, CLIENT_KNOBS->GLOBAL_CONFIG_REFRESH_MAX_BACKOFF);
162-
loop {
160+
while (true) {
163161
Error err;
164162
try {
165163
GlobalConfigRefreshReply reply =
@@ -189,7 +187,7 @@ Future<Version> GlobalConfig::refresh(Version lastKnown, Version largestSeen) {
189187
// Applies updates to the local copy of the global configuration when this
190188
// process receives an updated history.
191189
Future<Void> GlobalConfig::updater(const ClientDBInfo* dbInfo) {
192-
loop {
190+
while (true) {
193191
Error err;
194192
try {
195193
if (initialized.canBeSet()) {
@@ -202,7 +200,7 @@ Future<Void> GlobalConfig::updater(const ClientDBInfo* dbInfo) {
202200
cx->delref();
203201
}
204202

205-
loop {
203+
while (true) {
206204
// run one iteration at the beginning
207205
co_await delay(0);
208206
if (!dbInfo->history.empty()) {

fdbclient/SpecialKeySpace.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@
4040
#include "fdbclient/ManagementAPI.h"
4141
#include "fdbclient/StatusClient.h"
4242
#include "flow/CoroUtils.h"
43-
#include "flow/actorcompiler.h" // This must be the last #include.
4443

4544
namespace {
4645
const std::string kTracingTransactionIdKey = "transaction_id";

fdbrpc/FlowGrpc.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
#include "fdbrpc/FlowGrpc.h"
2222
#include "flow/Error.h"
2323
#include "flow/Trace.h"
24-
#include "flow/actorcompiler.h" // This must be the last #include.
2524

2625
#ifdef FLOW_GRPC_ENABLED
2726

@@ -85,10 +84,10 @@ Future<Void> GrpcServer::runInternal() {
8584
// ASSERT(g_network->isOnMainThread()); // Unit-tests are not on main-thread?
8685

8786
Future<Void> next = Void();
88-
loop {
87+
while (true) {
8988
ASSERT(state_ != State::Shutdown);
9089

91-
loop {
90+
while (true) {
9291
co_await next;
9392
co_await delay(CONFIG_STARTUP_DELAY_BETWEEN_RESTART);
9493

fdbrpc/include/fdbrpc/ActorFuzz.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020

2121
#include "flow/flow.h"
2222
#include <vector>
23-
#include "flow/actorcompiler.h"
2423

2524
inline void throw_operation_failed() {
2625
throw operation_failed();
@@ -39,5 +38,3 @@ bool testFuzzActor(Future<int> (*actor)(FutureStream<int> const&, PromiseStream<
3938
// This is defined by ActorFuzz.actor.cpp (generated by actorFuzz.py)
4039
// Returns (tests passed, tests total)
4140
std::pair<int, int> actorFuzzTests();
42-
43-
#include "flow/unactorcompiler.h"

fdbrpc/sim2.cpp

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,6 @@
6161
#include "flow/IUDPSocket.h"
6262
#include "flow/IConnection.h"
6363

64-
#include "flow/actorcompiler.h" // This must be the last #include.
65-
6664
ISimulator* g_simulator = nullptr;
6765
thread_local ISimulator::ProcessInfo* ISimulator::currentProcess = nullptr;
6866
thread_local bool ISimulator::isMainThread = false;
@@ -457,15 +455,15 @@ struct Sim2Conn final : IConnection, ReferenceCounted<Sim2Conn> {
457455
}
458456

459457
static Future<Void> sender(Sim2Conn* self) {
460-
loop {
458+
while (true) {
461459
co_await self->writtenBytes.onChange(); // takes place on peer!
462460
ASSERT(g_simulator->getCurrentProcess() == self->peerProcess);
463461
co_await delay(.002 * deterministicRandom()->random01());
464462
self->sentBytes.set(self->writtenBytes.get()); // or possibly just some sometimes...
465463
}
466464
}
467465
static Future<Void> receiver(Sim2Conn* self) {
468-
loop {
466+
while (true) {
469467
if (self->sentBytes.get() != self->receivedBytes.get())
470468
co_await g_simulator->onProcess(self->peerProcess);
471469
while (self->sentBytes.get() == self->receivedBytes.get())
@@ -502,7 +500,7 @@ struct Sim2Conn final : IConnection, ReferenceCounted<Sim2Conn> {
502500
}
503501
static Future<Void> whenReadable(Sim2Conn* self) {
504502
try {
505-
loop {
503+
while (true) {
506504
if (self->readBytes.get() != self->receivedBytes.get()) {
507505
ASSERT(g_simulator->getCurrentProcess() == self->process);
508506
co_return;
@@ -517,7 +515,7 @@ struct Sim2Conn final : IConnection, ReferenceCounted<Sim2Conn> {
517515
}
518516
static Future<Void> whenWritable(Sim2Conn* self) {
519517
try {
520-
loop {
518+
while (true) {
521519
if (!self->peer)
522520
co_return;
523521
if (self->peer->availableSendBufferForPeer() > 0) {
@@ -1221,7 +1219,7 @@ class Sim2 final : public ISimulator, public INetworkConnections {
12211219
}
12221220
static Future<Reference<IConnection>> waitForProcessAndConnect(NetworkAddress toAddr, INetworkConnections* self) {
12231221
// We have to be able to connect to processes that don't yet exist, so we do some silly polling
1224-
loop {
1222+
while (true) {
12251223
co_await ::delay(0.1 * deterministicRandom()->random01());
12261224
if (g_sim2.addressMap.contains(toAddr)) {
12271225
Reference<IConnection> c = co_await self->connect(toAddr);

0 commit comments

Comments
 (0)