Skip to content

Commit

Permalink
(#294)
Browse files Browse the repository at this point in the history
Throwing std::invalid_argument when doing some_service->read/writeFile(LOCATION(some_other_service,...))
  • Loading branch information
henricasanova committed Nov 2, 2024
1 parent 7f22d7c commit 18d45e7
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 467 deletions.
4 changes: 1 addition & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -266,8 +266,6 @@ set(SOURCE_FILES
include/wrench/services/compute/batch/batch_schedulers/BatchScheduler.h
include/wrench/services/compute/batch/batch_schedulers/homegrown/HomegrownBatchScheduler.h
include/wrench/services/storage/storage_helpers/FileTransferThread.h
include/wrench/services/storage/storage_helpers/LogicalFileSystemNoCaching.h
include/wrench/services/storage/storage_helpers/LogicalFileSystemLRUCaching.h
src/wrench/logging/TerminalOutput.cpp
src/wrench/managers/data_movement_manager/DataMovementManager.cpp
src/wrench/managers/data_movement_manager/DataMovementManagerMessage.cpp
Expand Down Expand Up @@ -461,9 +459,9 @@ set(TEST_FILES
test/services/compute_services/bare_metal_compound_jobs/BareMetalComputeServiceMultiActionTests.cpp
test/services/compute_services/bare_metal_compound_jobs/BareMetalComputeServiceMultiJobTests.cpp
test/services/compute_services/bare_metal_standard_jobs/BareMetalComputeServiceOneTaskTest.cpp
test/services/storage_services/LogicalFileSystem/LogicalFileSystemTest.cpp
test/services/storage_services/SimpleStorageService/SimpleStorageServiceCachingTest.cpp
test/services/storage_services/SimpleStorageService/SimpleStorageServiceFunctionalTest.cpp
test/services/storage_services/SimpleStorageService/SimpleStorageServiceWrongServiceTest.cpp
test/services/storage_services/SimpleStorageService/SimpleStorageServicePerformanceTest.cpp
test/services/storage_services/SimpleStorageService/SimpleStorageServiceLimitedConnectionsTest.cpp
test/services/storage_services/SimpleStorageService/StorageServiceDeleteRegisterTest.cpp
Expand Down

This file was deleted.

This file was deleted.

8 changes: 8 additions & 0 deletions src/wrench/services/storage/StorageService.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,10 @@ namespace wrench {
throw std::invalid_argument("StorageService::writeFile(): Invalid arguments");
}

if (location->getStorageService() != this->getSharedPtr<StorageService>()) {
throw std::invalid_argument("StorageService::writeFile(): Can only read from a location at that same storage service");
}

this->assertServiceIsUp();

this->commport->putMessage(
Expand Down Expand Up @@ -249,6 +253,10 @@ namespace wrench {
throw std::invalid_argument("StorageService::readFile(): Invalid nullptr/0 arguments");
}

if (location->getStorageService() != this->getSharedPtr<StorageService>()) {
throw std::invalid_argument("StorageService::readFile(): Can only read from a location at that same storage service");
}

assertServiceIsUp(this->getSharedPtr<Service>());

this->commport->putMessage(
Expand Down
Loading

0 comments on commit 18d45e7

Please sign in to comment.