diff --git a/fdbbackup/backup.actor.cpp b/fdbbackup/backup.actor.cpp index 067b56331f..a349f1b876 100644 --- a/fdbbackup/backup.actor.cpp +++ b/fdbbackup/backup.actor.cpp @@ -1322,7 +1322,7 @@ ACTOR Future runDBAgent(Database src, Database dest) { loop { try { - state Void run = wait(backupAgent.run(dest, &pollDelay, CLIENT_KNOBS->BACKUP_TASKS_PER_AGENT)); + wait(backupAgent.run(dest, &pollDelay, CLIENT_KNOBS->BACKUP_TASKS_PER_AGENT)); break; } catch (Error& e) { @@ -1347,7 +1347,7 @@ ACTOR Future runAgent(Database db) { loop { try { - state Void run = wait(backupAgent.run(db, &pollDelay, CLIENT_KNOBS->BACKUP_TASKS_PER_AGENT)); + wait(backupAgent.run(db, &pollDelay, CLIENT_KNOBS->BACKUP_TASKS_PER_AGENT)); break; } catch (Error& e) { diff --git a/fdbrpc/actorFuzz.py b/fdbrpc/actorFuzz.py index a2c2196302..49187669c4 100644 --- a/fdbrpc/actorFuzz.py +++ b/fdbrpc/actorFuzz.py @@ -347,7 +347,7 @@ class throwF2(throwF): class throwF3(throwF): def __str__(self): - return indent(self.cx) + "Void _ = wait( error ); // throw operation_failed()\n" + return indent(self.cx) + "wait( error ); // throw operation_failed()\n" def unreachable(self): return False # The actor compiler doesn't know that 'error' always contains an error diff --git a/fdbrpc/sim_validation.h b/fdbrpc/sim_validation.h index 75eb232b5a..1d563aaa23 100644 --- a/fdbrpc/sim_validation.h +++ b/fdbrpc/sim_validation.h @@ -30,7 +30,7 @@ // effect outside simulation. // Typical use is something like: // debug_advanceMaxCommittedVersion( self->id, version ); -// Void _ = wait( commit(version) ); +// wait( commit(version) ); // debug_advanceMinCommittedVersion( self->id, version ); // and then a call to debug_checkRestoredVersion() after some kind of reboot or recovery event diff --git a/fdbserver/DataDistribution.actor.cpp b/fdbserver/DataDistribution.actor.cpp index 58f7541f49..61fc50e6c0 100644 --- a/fdbserver/DataDistribution.actor.cpp +++ b/fdbserver/DataDistribution.actor.cpp @@ -18,7 +18,6 @@ * limitations under the License. */ -#include "flow/actorcompiler.h" // This must be the last #include. #include "flow/ActorCollection.h" #include "DataDistribution.h" #include "fdbclient/SystemData.h" @@ -32,6 +31,7 @@ #include "fdbclient/ManagementAPI.h" #include "fdbrpc/Replication.h" #include "flow/UnitTest.h" +#include "flow/actorcompiler.h" // This must be the last #include. class TCTeamInfo; diff --git a/fdbserver/SimulatedCluster.actor.cpp b/fdbserver/SimulatedCluster.actor.cpp index b4faa3d503..99fc392cf0 100644 --- a/fdbserver/SimulatedCluster.actor.cpp +++ b/fdbserver/SimulatedCluster.actor.cpp @@ -147,7 +147,7 @@ ACTOR Future runBackup( Reference connFile ) { } } - Void _= wait(Future(Never())); + wait(Future(Never())); throw internal_error(); } @@ -188,7 +188,7 @@ ACTOR Future runDr( Reference connFile ) { } } - Void _= wait(Future(Never())); + wait(Future(Never())); throw internal_error(); } diff --git a/fdbserver/workloads/ApiCorrectness.actor.cpp b/fdbserver/workloads/ApiCorrectness.actor.cpp index 5c7cdd6d23..3376cbba88 100644 --- a/fdbserver/workloads/ApiCorrectness.actor.cpp +++ b/fdbserver/workloads/ApiCorrectness.actor.cpp @@ -150,7 +150,7 @@ public: ACTOR Future performTest(Database cx, Standalone> data, ApiCorrectnessWorkload *self) { //Run the scripted test for a maximum of 10 minutes - Void _scripted = wait(timeout(self->runScriptedTest(self, data), 600, Void())); + wait(timeout(self->runScriptedTest(self, data), 600, Void())); if(!self->hasFailed()) { //Return database to original state (for a maximum of 1800 seconds) @@ -169,7 +169,7 @@ public: } //Run the random test for the user-specified duration - Void _random = wait(timeout(self->runRandomTest(self, data), self->randomTestDuration, Void())); + wait(timeout(self->runRandomTest(self, data), self->randomTestDuration, Void())); } return Void(); @@ -335,7 +335,7 @@ public: break; } catch(Error &e) { - Void _ = wait(transaction->onError(e)); + wait(transaction->onError(e)); } } } diff --git a/fdbserver/workloads/AsyncFileCorrectness.actor.cpp b/fdbserver/workloads/AsyncFileCorrectness.actor.cpp index 1dfaf704a9..8acdbf94a2 100644 --- a/fdbserver/workloads/AsyncFileCorrectness.actor.cpp +++ b/fdbserver/workloads/AsyncFileCorrectness.actor.cpp @@ -117,7 +117,7 @@ struct AsyncFileCorrectnessWorkload : public AsyncFileWorkload self->fileSize = 0; //Create or open the file being used for testing - Void _ = wait(self->openFile(self, IAsyncFile::OPEN_READWRITE | IAsyncFile::OPEN_CREATE, 0666, self->fileSize, true)); + wait(self->openFile(self, IAsyncFile::OPEN_READWRITE | IAsyncFile::OPEN_CREATE, 0666, self->fileSize, true)); return Void(); } diff --git a/fdbserver/workloads/BulkSetup.actor.h b/fdbserver/workloads/BulkSetup.actor.h index 1489a6cbb5..78b3b73fa5 100644 --- a/fdbserver/workloads/BulkSetup.actor.h +++ b/fdbserver/workloads/BulkSetup.actor.h @@ -170,7 +170,7 @@ ACTOR static Future > > trackInsertionCount(Databa { state Future> countFuture = tr.getRange(keyPrefix, 1000000000); state Future> bytesFuture = tr.getRange(bytesPrefix, 1000000000); - Void __ = wait(success(countFuture) && success(bytesFuture)); + wait(success(countFuture) && success(bytesFuture)); Standalone counts = countFuture.get(); Standalone bytes = bytesFuture.get(); diff --git a/fdbserver/workloads/IndexScan.actor.cpp b/fdbserver/workloads/IndexScan.actor.cpp index beff0911be..5be071c82a 100644 --- a/fdbserver/workloads/IndexScan.actor.cpp +++ b/fdbserver/workloads/IndexScan.actor.cpp @@ -96,7 +96,7 @@ struct IndexScanWorkload : KVWorkload { state double start = now(); try { loop { - Void _ = wait( scanDatabase( cx, self ) ); + wait( scanDatabase( cx, self ) ); } } catch( ... ) { self->totalTimeFetching = now() - start; diff --git a/fdbserver/workloads/ReadWrite.actor.cpp b/fdbserver/workloads/ReadWrite.actor.cpp index 39634b83d6..0b4141b316 100644 --- a/fdbserver/workloads/ReadWrite.actor.cpp +++ b/fdbserver/workloads/ReadWrite.actor.cpp @@ -520,7 +520,7 @@ struct ReadWriteWorkload : KVWorkload { state UID debugID; if (self->rampUpConcurrency) { - Void _ = wait( ::delay( self->testDuration/2 * (double(clientIndex) / self->actorCount + double(self->clientId) / self->clientCount / self->actorCount) ) ); + wait( ::delay( self->testDuration/2 * (double(clientIndex) / self->actorCount + double(self->clientId) / self->clientCount / self->actorCount) ) ); TraceEvent("ClientStarting").detail("ActorIndex", clientIndex).detail("ClientIndex", self->clientId).detail("NumActors", clientIndex*self->clientCount + self->clientId + 1); } diff --git a/flow/actorcompiler/ActorParser.cs b/flow/actorcompiler/ActorParser.cs index 1751f45aa5..4d3c4990e3 100644 --- a/flow/actorcompiler/ActorParser.cs +++ b/flow/actorcompiler/ActorParser.cs @@ -556,6 +556,11 @@ namespace actorcompiler bool constructorSyntax; ParseDeclaration( toks.RevSkipWhile(t=>t.Value==";"), out name, out type, out initializer, out constructorSyntax ); + string typestring = str(NormalizeWhitespace(type)); + if (typestring == "Void") { + throw new Error(ws.FirstSourceLine, "Assigning the result of a Void wait is not allowed. Just use a standalone wait statement."); + } + ws.result = new VarDeclaration { name = name.Value,