diff --git a/catalogue/rdbms/RdbmsArchiveFileCatalogue.cpp b/catalogue/rdbms/RdbmsArchiveFileCatalogue.cpp index d8414024423c6182402145a105c416fef5aeef0b..5985ad193bddc93cc5d655e4849f399c36acc525 100644 --- a/catalogue/rdbms/RdbmsArchiveFileCatalogue.cpp +++ b/catalogue/rdbms/RdbmsArchiveFileCatalogue.cpp @@ -195,7 +195,7 @@ common::dataStructures::ArchiveFile RdbmsArchiveFileCatalogue::getArchiveFileCop << " or " << common::dataStructures::Tape::stateToString(common::dataStructures::Tape::BROKEN) << " states"; throw exception::UserError(oss.str()); } - } catch (const TapeNotFound &ex) { + } catch (const TapeNotFound&) { throw exception::UserError(std::string("Tape ") + vid + " not found"); } diff --git a/catalogue/rdbms/RdbmsDriveStateCatalogue.cpp b/catalogue/rdbms/RdbmsDriveStateCatalogue.cpp index 2d6c31a81070fbe7b559ca2d405a1ba23917ee3d..540b9bb022143c7cf1a78432763393265360c46f 100644 --- a/catalogue/rdbms/RdbmsDriveStateCatalogue.cpp +++ b/catalogue/rdbms/RdbmsDriveStateCatalogue.cpp @@ -276,7 +276,7 @@ void RdbmsDriveStateCatalogue::settingSqlTapeDriveValues(cta::rdbms::Stmt *stmt, setOptionalString(":NEXT_VO", tapeDrive.nextVo); setOptionalString(":USER_COMMENT", tapeDrive.userComment); - auto setEntryLog = [stmt, setOptionalString, setOptionalTime](const std::string &field, + auto setEntryLog = [setOptionalString, setOptionalTime](const std::string &field, const std::optional &username, const std::optional &host, const std::optional &time) { setOptionalString(field + "_USER_NAME", username); setOptionalString(field + "_HOST_NAME", host); diff --git a/catalogue/rdbms/oracle/OracleTapeFileCatalogue.cpp b/catalogue/rdbms/oracle/OracleTapeFileCatalogue.cpp index 2f8ff7a9075d0614c77d8db659b88d40edda2ff5..904ff0a34323287f19d93614fce631333a9c50bd 100644 --- a/catalogue/rdbms/oracle/OracleTapeFileCatalogue.cpp +++ b/catalogue/rdbms/oracle/OracleTapeFileCatalogue.cpp @@ -406,7 +406,7 @@ void OracleTapeFileCatalogue::idempotentBatchInsertArchiveFiles(rdbms::Conn &con try { std::string adler32hex = checksum::ChecksumBlob::ByteArrayToHex(event.checksumBlob.at(checksum::ADLER32)); adler32[i] = strtoul(adler32hex.c_str(), nullptr, 16); - } catch(exception::ChecksumTypeMismatch &ex) { + } catch(exception::ChecksumTypeMismatch&) { // No ADLER32 checksum exists in the checksumBlob adler32[i] = 0; } diff --git a/catalogue/rdbms/postgres/PostgresCatalogue.cpp b/catalogue/rdbms/postgres/PostgresCatalogue.cpp index 1cc333f3117eda65f0a9f957e4447dbca789b1c4..763b9a16a1e7b3a3c13158316298b63fb50923e5 100644 --- a/catalogue/rdbms/postgres/PostgresCatalogue.cpp +++ b/catalogue/rdbms/postgres/PostgresCatalogue.cpp @@ -59,7 +59,7 @@ std::string PostgresCatalogue::createAndPopulateTempTableFxid(rdbms::Conn &conn, std::string sql = "CREATE TEMPORARY TABLE " + tempTableName + "(DISK_FILE_ID VARCHAR(100))"; try { conn.executeNonQuery(sql); - } catch(exception::Exception &ex) { + } catch(exception::Exception&) { // Postgres does not drop temporary tables until the end of the session; trying to create another // temporary table in the same unit test will fail. If this happens, truncate the table and carry on. std::string sql2 = "TRUNCATE TABLE " + tempTableName; diff --git a/cmdline/CtaAdminParsedCmd.cpp b/cmdline/CtaAdminParsedCmd.cpp index 69233c83ddd84c808b022ac386049050ce51988e..b9a0d953e4e60457cf70e9933a7cccaf99abd559 100644 --- a/cmdline/CtaAdminParsedCmd.cpp +++ b/cmdline/CtaAdminParsedCmd.cpp @@ -192,7 +192,7 @@ void CtaAdminParsedCmd::addOption(const Option& option, const std::string& value if (option == opt_drivename_cmd && value == "first") { try { new_opt->set_value(cta::tape::daemon::common::TapedConfiguration::getFirstDriveName()); - } catch (cta::exception::Exception& ex) { + } catch (cta::exception::Exception&) { throw std::runtime_error( "Could not find a taped configuration file. This option should only be run from a tapeserver."); } diff --git a/cmdline/standalone_cli_tools/change_storage_class/ChangeStorageClass.cpp b/cmdline/standalone_cli_tools/change_storage_class/ChangeStorageClass.cpp index b93a8f5e64cbc9269d361d0195eb5d5f86308aa6..74500706b10a7ab167e90d70ba85d2b53771fb3a 100644 --- a/cmdline/standalone_cli_tools/change_storage_class/ChangeStorageClass.cpp +++ b/cmdline/standalone_cli_tools/change_storage_class/ChangeStorageClass.cpp @@ -261,7 +261,7 @@ void ChangeStorageClass::updateStorageClassInCatalogue(const std::string& archiv // Validate the Protocol Buffer try { cta::admin::validateCmd(*admincmd); - } catch(std::runtime_error &ex) { + } catch(std::runtime_error&) { throw std::runtime_error("Error: Protocol Buffer validation"); } diff --git a/common/checksum/ChecksumBlob.hpp b/common/checksum/ChecksumBlob.hpp index addfb37d1d24fa9be1f5ec0928869a01cd0b79ce..33552cb5221447ce0618590184335fe54eb2987f 100644 --- a/common/checksum/ChecksumBlob.hpp +++ b/common/checksum/ChecksumBlob.hpp @@ -163,9 +163,9 @@ public: bool contains(ChecksumType type, const std::string& value) const { try { validate(type, value); - } catch (exception::ChecksumTypeMismatch& ex) { + } catch (exception::ChecksumTypeMismatch&) { return false; - } catch (exception::ChecksumValueMismatch& ex) { + } catch (exception::ChecksumValueMismatch&) { return false; } return true; @@ -177,11 +177,11 @@ public: bool operator==(const ChecksumBlob& blob) const { try { validate(blob); - } catch (exception::ChecksumBlobSizeMismatch& ex) { + } catch (exception::ChecksumBlobSizeMismatch&) { return false; - } catch (exception::ChecksumTypeMismatch& ex) { + } catch (exception::ChecksumTypeMismatch&) { return false; - } catch (exception::ChecksumValueMismatch& ex) { + } catch (exception::ChecksumValueMismatch&) { return false; } return true; diff --git a/common/config/Config.cpp b/common/config/Config.cpp index f6a1e257dc5d121adc5d25a62cefd295caf96dc1..b6bef90673610f19878c4dba154826b04ef40008 100644 --- a/common/config/Config.cpp +++ b/common/config/Config.cpp @@ -145,7 +145,7 @@ T Config::stou(const std::string& strVal) const { if (static_cast(lVal) > std::numeric_limits::max()) { throw std::out_of_range("Above maximum value"); } - } catch (const std::invalid_argument& ex) { + } catch (const std::invalid_argument&) { std::ostringstream strErrMsg; strErrMsg << "stou(" << strVal << "): Invalid argument"; throw std::invalid_argument(strErrMsg.str()); diff --git a/common/dataStructures/Tape.cpp b/common/dataStructures/Tape.cpp index f434d61a66b059c871218dbb5eb6f234b7de842c..882712c39e520ec52d973230d0fdf876bda84ac5 100644 --- a/common/dataStructures/Tape.cpp +++ b/common/dataStructures/Tape.cpp @@ -110,7 +110,7 @@ std::string Tape::getStateStr() const { std::string Tape::stateToString(const Tape::State & state) { try { return Tape::STATE_TO_STRING_MAP.at(state); - } catch (std::out_of_range &ex){ + } catch (std::out_of_range&){ throw cta::exception::Exception(std::string("The state given (") + std::to_string(state) + ") does not exist."); } } @@ -120,7 +120,7 @@ Tape::State Tape::stringToState(const std::string& stateStr, bool hidePendingSta cta::utils::toUpper(stateUpperCase); try { return Tape::STRING_TO_STATE_MAP.at(stateUpperCase); - } catch(std::out_of_range &ex){ + } catch(std::out_of_range&){ throw cta::exception::UserError(std::string("The state given (") + stateUpperCase + ") does not exist. Possible values are " + Tape::getAllPossibleStates(hidePendingStates)); } } @@ -152,7 +152,7 @@ std::ostream &operator<<(std::ostream &os, const Tape &obj) { std::string stateStr = "UNKNOWN"; try { stateStr = Tape::stateToString(obj.state); - } catch(const cta::exception::Exception &ex){ + } catch(const cta::exception::Exception &){ //Do nothing } os << "(vid=" << obj.vid diff --git a/common/dataStructures/TapeDrive.cpp b/common/dataStructures/TapeDrive.cpp index 48a08190ac2e894c0c920818a1dd6b6c1cd38b94..b867adb7b25b54b2a698b19f5f37bdc5e447ad67 100644 --- a/common/dataStructures/TapeDrive.cpp +++ b/common/dataStructures/TapeDrive.cpp @@ -146,7 +146,7 @@ std::string TapeDrive::getStateStr() const { std::string TapeDrive::stateToString(const DriveStatus & state) { try { return TapeDrive::STATE_TO_STRING_MAP.at(state); - } catch (std::out_of_range &ex){ + } catch (std::out_of_range&){ throw cta::exception::Exception(std::string("The state given (") + std::to_string(state) + ") does not exist."); } @@ -157,7 +157,7 @@ DriveStatus TapeDrive::stringToState(const std::string& state) { cta::utils::toUpper(stateUpperCase); try { return TapeDrive::STRING_TO_STATE_MAP.at(stateUpperCase); - } catch(std::out_of_range &ex){ + } catch(std::out_of_range&){ throw cta::exception::Exception(std::string("The state given (") + stateUpperCase + ") does not exist. Possible values are " + TapeDrive::getAllPossibleStates()); } diff --git a/common/log/PriorityMaps.cpp b/common/log/PriorityMaps.cpp index 32c1f31347379e62be04a5e7d943712e3eee7740..561241d5f364b155edc140ab557eb4e32f561a27 100644 --- a/common/log/PriorityMaps.cpp +++ b/common/log/PriorityMaps.cpp @@ -34,7 +34,7 @@ namespace cta::log { {INFO,"INFO"}, {DEBUG,"DEBUG"}, }; - + const std::map PriorityMaps::c_configTextToPriorityMap = { {"LOG_EMERG",LOG_EMERG}, {"ALERT",ALERT}, @@ -45,12 +45,12 @@ namespace cta::log { {"INFO",INFO}, {"DEBUG",DEBUG}, }; - + std::string PriorityMaps::getPriorityText(const int priority){ std::string ret = ""; try { ret = c_priorityToTextMap.at(priority); - } catch(const std::exception & ex){ + } catch(const std::exception &){ //if no corresponding priority, we return an empty string } return ret; diff --git a/disk/DiskFile.cpp b/disk/DiskFile.cpp index 600fcf9fde0fb5c2e960e4df30e27d0fbca11bd8..376683fdd230717d3e67491c4870241a8bb71c18 100644 --- a/disk/DiskFile.cpp +++ b/disk/DiskFile.cpp @@ -265,7 +265,7 @@ void XRootdDiskFileRemover::removeAsync(AsyncXRootdDiskFileRemover::XRootdFileRe XrdCl::XRootDStatus statusRm = m_xrootFileSystem.Rm(m_truncatedFileURL, &responseHandler, c_xrootTimeout); try { exception::XrdClException::throwOnError(statusRm, "In XRootdDiskFileRemover::remove(), fail to remove file."); - } catch (const cta::exception::Exception& e) { + } catch (const cta::exception::Exception&) { responseHandler.m_deletionPromise.set_exception(std::current_exception()); } } @@ -290,7 +290,7 @@ void AsyncXRootdDiskFileRemover::XRootdFileRemoverResponseHandler::HandleRespons try { exception::XrdClException::throwOnError(*status, "In XRootdDiskFileRemover::remove(), fail to remove file."); m_deletionPromise.set_value(); - } catch (const cta::exception::Exception& e) { + } catch (const cta::exception::Exception&) { m_deletionPromise.set_exception(std::current_exception()); } } diff --git a/disk/DiskSystem.cpp b/disk/DiskSystem.cpp index 8315006e7c6b13fa886bccfc7303c40fd137d31e..55cf6f158955d2cce2a181278915774f4f4119c8 100644 --- a/disk/DiskSystem.cpp +++ b/disk/DiskSystem.cpp @@ -222,7 +222,7 @@ uint64_t DiskSystemFreeSpaceList::fetchFreeDiskSpaceWithScript(const std::string std::string logMessage = "In DiskSystemFreeSpaceList::fetchFreeDiskSpaceWithScript(), freeSpace returned from the script is: " + std::to_string(jsonFreeSpace.m_freeSpace); lc.log(log::DEBUG,logMessage); return jsonFreeSpace.m_freeSpace; - } catch(const cta::exception::JSONObjectException &ex){ + } catch(const cta::exception::JSONObjectException&){ std::string errMsg = "In DiskSystemFreeSpaceList::fetchFreeDiskSpaceWithScript(): the json received from the script "+ scriptPath + " json=" + stdoutScript + " could not be used to get the FreeSpace, the json to receive from the script should have the following format: " + jsonFreeSpace.getExpectedJSONToBuildObject() + "."; diff --git a/frontend/grpc/CtaAdminGrpcCmd.cpp b/frontend/grpc/CtaAdminGrpcCmd.cpp index 511bff8a891723d86a0c4312a5a58ea5462e481d..81aeb07c5aa58676acb75a8fe03d5ceebfb5b572 100644 --- a/frontend/grpc/CtaAdminGrpcCmd.cpp +++ b/frontend/grpc/CtaAdminGrpcCmd.cpp @@ -96,7 +96,7 @@ void CtaAdminGrpcCmd::send(const CtaAdminParsedCmd& parsedCmd, */ strEncodedToken = cta::utils::base64encode(strToken); - } catch (const cta::exception::Exception& e) { + } catch (const cta::exception::Exception&) { /* * In case of any problems with the negotiation service, * log and stop the execution @@ -106,7 +106,7 @@ void CtaAdminGrpcCmd::send(const CtaAdminParsedCmd& parsedCmd, throw; // rethrow } /* - * Channel arguments can be overriden e.g: + * Channel arguments can be overriden e.g: * ::grpc::ChannelArguments channelArgs;ClientContext * channelArgs.SetString(GRPC_SSL_TARGET_NAME_OVERRIDE_ARG, "ok.org"); * std::shared_ptr<::grpc::Channel> spChannel {::grpc::CreateCustomChannel("0.0.0.0:17017", spCredentials, channelArgs)}; diff --git a/mediachanger/io.cpp b/mediachanger/io.cpp index b43ac6a825aabf16e47a2d8136d5b6c4232cd628..f86f56d39bd78e96861348b490a5fcb1b18abb01 100644 --- a/mediachanger/io.cpp +++ b/mediachanger/io.cpp @@ -600,7 +600,7 @@ void writeSockDescription( IpAndPort localIpAndPort(0, 0); try { localIpAndPort = getSockIpPort(socketFd); - } catch(cta::exception::Exception &e) { + } catch(cta::exception::Exception&) { localIpAndPort.ip = 0; localIpAndPort.port = 0; } @@ -608,7 +608,7 @@ void writeSockDescription( IpAndPort peerIpAndPort(0, 0); try { peerIpAndPort = getPeerIpPort(socketFd); - } catch(cta::exception::Exception &e) { + } catch(cta::exception::Exception&) { peerIpAndPort.ip = 0; peerIpAndPort.port = 0; } diff --git a/objectstore/ArchiveQueue.cpp b/objectstore/ArchiveQueue.cpp index ca53b5e191540cf132b93338d7edd660665af99b..edd28b34570bf4b3b1efea3dd7123da8914a5e3f 100644 --- a/objectstore/ArchiveQueue.cpp +++ b/objectstore/ArchiveQueue.cpp @@ -139,7 +139,7 @@ void ArchiveQueue::rebuild() { bool shardObjectNotFound = false; try { (*sf)->wait(); - } catch (cta::exception::NoSuchObject & ex) { + } catch (cta::exception::NoSuchObject&) { shardObjectNotFound = true; } if (shardObjectNotFound || s->dumpJobs().empty()) { @@ -228,7 +228,7 @@ void ArchiveQueue::recomputeOldestAndYoungestJobCreationTime(){ bool shardObjectNotFound = false; try { (*sf)->wait(); - } catch (cta::exception::NoSuchObject & ex) { + } catch (cta::exception::NoSuchObject&) { shardObjectNotFound = true; } if (shardObjectNotFound || s->dumpJobs().empty()) { @@ -348,7 +348,7 @@ void ArchiveQueue::addJobsAndCommit(std::list & jobsToAdd, AgentRefere m_exclusiveLock->includeSubObject(aqs); try { aqs.fetch(); - } catch (cta::exception::NoSuchObject & ex) { + } catch (cta::exception::NoSuchObject&) { log::ScopedParamContainer params (lc); params.add("archiveQueueObject", getAddressIfSet()) .add("shardNumber", shardCount - 1) @@ -475,7 +475,7 @@ ArchiveQueue::AdditionSummary ArchiveQueue::addJobsIfNecessaryAndCommit(std::lis while (s!= shards.end()) { try { (*sf)->wait(); - } catch (cta::exception::NoSuchObject & ex) { + } catch (cta::exception::NoSuchObject&) { goto nextShard; } shardsDumps.emplace_back(std::list()); @@ -606,7 +606,7 @@ auto ArchiveQueue::dumpJobs() -> std::list { while (s != shards.end()) { try { (*sf)->wait(); - } catch (cta::exception::NoSuchObject & ex) { + } catch (cta::exception::NoSuchObject&) { // We are possibly in read only mode, so we cannot rebuild. // Just skip this shard. goto nextShard; diff --git a/objectstore/ArchiveQueueAlgorithms.hpp b/objectstore/ArchiveQueueAlgorithms.hpp index 7e3ed4015af1573c11f01b084651e411570086b0..5228520762284a34ca3a659435b1aba1c3132673 100644 --- a/objectstore/ArchiveQueueAlgorithms.hpp +++ b/objectstore/ArchiveQueueAlgorithms.hpp @@ -289,7 +289,7 @@ getLockedAndFetchedNoCreate(Container& cont, ScopedExclusiveLock& contLock, cons cont.fetch(); tl.insertAndReset("queueFetchTime",t); //lockFetchQueueTime += localLockFetchQueueTime = t.secs(utils::Timer::resetCounter); - } catch (cta::exception::Exception & ex) { + } catch (cta::exception::Exception&) { // The queue is now absent. We can remove its reference in the root entry. // A new queue could have been added in the mean time, and be non-empty. // We will then fail to remove from the RootEntry (non-fatal). @@ -312,7 +312,7 @@ getLockedAndFetchedNoCreate(Container& cont, ScopedExclusiveLock& contLock, cons .add("exceptionMessage", ex.getMessageValue()); tl.addToLog(params); lc.log(log::INFO, "In ContainerTraits::getLockedAndFetchedNoCreate(): could not de-referenced missing queue from root entry"); - } catch (RootEntry::NoSuchArchiveQueue & ex) { + } catch (RootEntry::NoSuchArchiveQueue&) { // Somebody removed the queue in the mean time. Barely worth mentioning. log::ScopedParamContainer params(lc); params.add("tapepool", cId) diff --git a/objectstore/ArchiveRequest.cpp b/objectstore/ArchiveRequest.cpp index 81e2e7e0a3a0009fedd3d76caad5cc2df12eb8cd..e22abcf70a8bcfe8d2cc0ded61cbad379fb56fef 100644 --- a/objectstore/ArchiveRequest.cpp +++ b/objectstore/ArchiveRequest.cpp @@ -482,7 +482,7 @@ void ArchiveRequest::garbageCollect(const std::string &presumedOwner, AgentRefer .add("commitUnlockQueueTime", commitUnlockQueueTime) .add("sleepTime", sleepTime); lc.log(log::INFO, "In ArchiveRequest::garbageCollect(): slept some time to not sit on the queue after GC requeueing."); - } catch (JobNotQueueable &ex){ + } catch (JobNotQueueable&){ log::ScopedParamContainer params(lc); params.add("jobObject", getAddressIfSet()) .add("queueObject", queueObject) @@ -548,7 +548,7 @@ ArchiveRequest::AsyncJobOwnerUpdater* ArchiveRequest::asyncUpdateJobOwner(uint32 // The unique pointer will be std::moved so we need to work with its content (bare pointer or here ref to content). auto & retRef = *ret; ret->m_updaterCallback= - [this, copyNumber, owner, previousOwner, &retRef, newStatus](const std::string &in)->std::string { + [copyNumber, owner, previousOwner, &retRef, newStatus](const std::string &in)->std::string { // We have a locked and fetched object, so we just need to work on its representation. retRef.m_timingReport.lockFetchTime = retRef.m_timer.secs(utils::Timer::resetCounter); serializers::ObjectHeader oh; diff --git a/objectstore/BackendRados.cpp b/objectstore/BackendRados.cpp index 67e01a8f342823bd77ee0fc7fce0b1036b0724f2..a87fb635962ecab67a0e74c809088db98a9bda6d 100644 --- a/objectstore/BackendRados.cpp +++ b/objectstore/BackendRados.cpp @@ -501,12 +501,12 @@ void BackendRados::lockBackoff(const std::string& name, uint64_t timeout_us, Loc while (true) { nbTriesToLock++; if (lockType==LockType::Shared) { - throwOnReturnedErrnoOrThrownStdException([&rc, &radosCtx, &name, &clientId, &radosLockExpirationTime, &t, &timeoutTimer]() { + throwOnReturnedErrnoOrThrownStdException([&rc, &radosCtx, &name, &clientId, &radosLockExpirationTime]() { rc = radosCtx.lock_shared(name, "lock", clientId, "", "", &radosLockExpirationTime, 0); return 0; }, "In BackendRados::lockBackoff(): failed radosCtx.lock_shared()"); } else { - throwOnReturnedErrnoOrThrownStdException([&rc, &radosCtx, &name, &clientId, &radosLockExpirationTime, &t, &timeoutTimer]() { + throwOnReturnedErrnoOrThrownStdException([&rc, &radosCtx, &name, &clientId, &radosLockExpirationTime]() { rc = radosCtx.lock_exclusive(name, "lock", clientId, "", &radosLockExpirationTime, 0); return 0; }, "In BackendRados::lockBackoff(): failed radosCtx.lock_exclusive()"); @@ -827,7 +827,7 @@ void BackendRados::AsyncUpdater::UpdateJob::execute() { try { // Execute the user's callback. value=au.m_update(value); - } catch (AsyncUpdateWithDelete & ex) { + } catch (AsyncUpdateWithDelete&) { updateWithDelete = true; } catch (...) { // Let exceptions fly through. User knows his own exceptions. diff --git a/objectstore/BackendVFS.cpp b/objectstore/BackendVFS.cpp index 27bee61328533617f3454718677b3c8806a3bb53..922b772fe3a4936eaa433bc55aecf069b25346d3 100644 --- a/objectstore/BackendVFS.cpp +++ b/objectstore/BackendVFS.cpp @@ -414,7 +414,7 @@ BackendVFS::AsyncUpdater::AsyncUpdater(BackendVFS & be, const std::string& name, bool updateWithDelete = false; try { postUpdateData=m_update(preUpdateData); - } catch (AsyncUpdateWithDelete & ex) { + } catch (AsyncUpdateWithDelete&) { updateWithDelete = true; } catch (...) { // Let user's exceptions go through. diff --git a/objectstore/GarbageCollector.cpp b/objectstore/GarbageCollector.cpp index ff04fbdf30c197163a53d1b4a7ceb4c85fa10e34..d991499fad860593d414377fcc2ca5aa85d3a351 100644 --- a/objectstore/GarbageCollector.cpp +++ b/objectstore/GarbageCollector.cpp @@ -138,7 +138,7 @@ void GarbageCollector::checkHeartbeats(log::LogContext & lc) { } else { ++wa; } - } catch (cta::exception::Exception & ex) { + } catch (cta::exception::Exception&) { if (wa->second->checkExists()) { // We really have a problem: we failed to check on an agent, that is still present. throw; @@ -161,7 +161,7 @@ void GarbageCollector::cleanupDeadAgent(const std::string & address, const std:: try { // The agent could be gone while we try to lock it. agLock.lock(agent); - } catch (cta::exception::NoSuchObject & ex) { + } catch (cta::exception::NoSuchObject&) { log::ScopedParamContainer params(lc); params.add("agentAddress", agent.getAddressIfSet()) .add("gcAgentAddress", m_ourAgentReference.getAgentAddress()); @@ -248,7 +248,7 @@ void GarbageCollector::OwnedObjectSorter::fetchOwnedObjects(Agent& agent, std::l params2.add("objectAddress", obj->getAddressIfSet()); try { ownedObjectsFetchers.at(obj.get())->wait(); - } catch (cta::exception::NoSuchObject & ex) { + } catch (cta::exception::NoSuchObject&) { goneObjects.push_back(obj->getAddressIfSet()); lc.log(log::INFO, "In GarbageCollector::OwnedObjectSorter::fetchOwnedObjects(): skipping garbage collection of now gone object."); ownedObjectsFetchers.erase(obj.get()); @@ -386,7 +386,7 @@ void GarbageCollector::OwnedObjectSorter::sortFetchedObjects(Agent& agent, std:: std::string vid; try { vid=Helpers::selectBestRetrieveQueue(candidateVids, catalogue, objectStore, lc, isRepack); - } catch (Helpers::NoTapeAvailableForRetrieve & ex) { + } catch (Helpers::NoTapeAvailableForRetrieve&) { log::ScopedParamContainer params3(lc); params3.add("fileId", rr->getArchiveFile().archiveFileID); lc.log(log::INFO, "In GarbageCollector::OwnedObjectSorter::sortFetchedObjects(): No available tape found. Marking request for normal GC (and probably deletion)."); diff --git a/objectstore/Helpers.cpp b/objectstore/Helpers.cpp index 5eadbb79c671a2f954ab13130e75d93f3fb98430..a15736739eb269515224038ca3d717a175c88556 100644 --- a/objectstore/Helpers.cpp +++ b/objectstore/Helpers.cpp @@ -66,7 +66,7 @@ void Helpers::getLockedAndFetchedJobQueue(ArchiveQueue& archiveQue rootFetchNoLockTime = t.secs(utils::Timer::resetCounter); try { archiveQueue.setAddress(re.getArchiveQueueAddress(tapePool.value(), queueType)); - } catch (cta::exception::Exception & ex) { + } catch (cta::exception::Exception&) { ScopedExclusiveLock rexl(re); rootRelockExclusiveTime = t.secs(utils::Timer::resetCounter); re.fetch(); @@ -183,7 +183,7 @@ void Helpers::getLockedAndFetchedJobQueue(RetrieveQueue& retrieve rootFetchNoLockTime = t.secs(utils::Timer::resetCounter); try { retrieveQueue.setAddress(re.getRetrieveQueueAddress(vid.value(), queueType)); - } catch (cta::exception::Exception & ex) { + } catch (cta::exception::Exception&) { ScopedExclusiveLock rexl(re); rootRelockExclusiveTime = t.secs(utils::Timer::resetCounter); re.fetch(); @@ -290,7 +290,7 @@ void Helpers::getLockedAndFetchedRepackQueue(RepackQueue& queue, ScopedExclusive timings.insertAndReset("rootFetchNoLockTime", t); try { queue.setAddress(re.getRepackQueueAddress(queueType)); - } catch (cta::exception::Exception & ex) { + } catch (cta::exception::Exception&) { ScopedExclusiveLock rexl(re); timings.insertAndReset("rootRelockExclusiveTime", t); re.fetch(); diff --git a/objectstore/QueueCleanupRunner.cpp b/objectstore/QueueCleanupRunner.cpp index 656e38d9b0d7cde8a61b39944d997c0d23afa38c..388cd74ee7bdcad5569de5e5888ce594d47e7d62 100644 --- a/objectstore/QueueCleanupRunner.cpp +++ b/objectstore/QueueCleanupRunner.cpp @@ -208,7 +208,7 @@ void QueueCleanupRunner::runOnePass(log::LogContext &logContext) { "change it to its corresponding final state."); break; } - } catch (const catalogue::UserSpecifiedAWrongPrevState& ex) { + } catch (const catalogue::UserSpecifiedAWrongPrevState&) { using common::dataStructures::Tape; auto tapeDataRefreshedUpdated = m_catalogue.Tape()->getTapesByVid(queueVid).at(queueVid); log::ScopedParamContainer paramsWarnMsg(logContext); diff --git a/objectstore/RepackQueueAlgorithms.hpp b/objectstore/RepackQueueAlgorithms.hpp index 0201b4f8f6d9721e2653ffd8d7e7c9cc79a40a6d..f62c6e1726fef13843e1511f2e1d4335c74b9e28 100644 --- a/objectstore/RepackQueueAlgorithms.hpp +++ b/objectstore/RepackQueueAlgorithms.hpp @@ -261,7 +261,7 @@ getLockedAndFetchedNoCreate(Container& cont, ScopedExclusiveLock& contLock, cons contLock.lock(cont); cont.fetch(); //lockFetchQueueTime += localLockFetchQueueTime = t.secs(utils::Timer::resetCounter); - } catch (cta::exception::NoSuchObject & ex) { + } catch (cta::exception::NoSuchObject&) { // The queue is now absent. We can remove its reference in the root entry. // A new queue could have been added in the mean time, and be non-empty. // We will then fail to remove from the RootEntry (non-fatal). diff --git a/objectstore/RepackRequest.cpp b/objectstore/RepackRequest.cpp index 2e8ef30c70f6a504af7245d37998f9c017169aa6..06ef229ff4bea5722bd39289da6ca91051f70442 100644 --- a/objectstore/RepackRequest.cpp +++ b/objectstore/RepackRequest.cpp @@ -775,7 +775,7 @@ void RepackRequest::garbageCollect(const std::string& presumedOwner, AgentRefere .add("requestsBefore",requestsBefore) .add("requestsAfter",requestsAfter); lc.log(log::INFO,"In RepackRequest::garbageCollect() succesfully requeued the RepackRequest."); - } catch(const cta::exception::Exception &e){ + } catch(const cta::exception::Exception&){ lc.log(log::INFO,"In RepackRequest::garbageCollect() failed to requeue the RepackRequest. Leaving it as it is."); } commit(); @@ -789,7 +789,7 @@ RepackRequest::AsyncOwnerAndStatusUpdater* RepackRequest::asyncUpdateOwnerAndSta std::unique_ptr ret(new AsyncOwnerAndStatusUpdater); auto & retRef = *ret; ret->m_updaterCallback= - [this, owner, previousOwner, &retRef, newStatus](const std::string &in)->std::string { + [owner, previousOwner, &retRef, newStatus](const std::string &in)->std::string { // We have a locked and fetched object, so we just need to work on its representation. retRef.m_timingReport.insertAndReset("lockFetchTime", retRef.m_timer); serializers::ObjectHeader oh; diff --git a/objectstore/RetrieveQueue.cpp b/objectstore/RetrieveQueue.cpp index 5e91015a9154ded9aa9ca21e9efc75c00251f830..91ccd24ddc9aed5745311f9e28b87b16d79b086b 100644 --- a/objectstore/RetrieveQueue.cpp +++ b/objectstore/RetrieveQueue.cpp @@ -114,13 +114,13 @@ void RetrieveQueue::rebuild() { uint64_t totalBytes=0; time_t oldestJobCreationTime=std::numeric_limits::max(); time_t youngestJobCreationTime=std::numeric_limits::min(); - + while (s != shards.end()) { // Each shard could be gone or be empty bool shardObjectNotFound = false; try { (*sf)->wait(); - } catch (cta::exception::NoSuchObject & ex) { + } catch (cta::exception::NoSuchObject&) { shardObjectNotFound = true; } if (shardObjectNotFound || s->dumpJobs().empty()) { @@ -556,7 +556,7 @@ auto RetrieveQueue::addJobsIfNecessaryAndCommit(std::listwait(); - } catch (cta::exception::NoSuchObject & ex) { + } catch (cta::exception::NoSuchObject&) { goto nextShard; } shardsDumps.emplace_back(std::list()); @@ -637,7 +637,7 @@ auto RetrieveQueue::dumpJobs() -> std::list { while (s != shards.end()) { try { (*sf)->wait(); - } catch (cta::exception::NoSuchObject & ex) { + } catch (cta::exception::NoSuchObject&) { // We are possibly in read only mode, so we cannot rebuild. // Just skip this shard. goto nextShard; diff --git a/objectstore/RetrieveQueueAlgorithms.hpp b/objectstore/RetrieveQueueAlgorithms.hpp index a759a6092bae053ad6af5b575d5497cd77c27408..dc9bfc75b0ae9d4ecb11fc788e380d879c02923b 100644 --- a/objectstore/RetrieveQueueAlgorithms.hpp +++ b/objectstore/RetrieveQueueAlgorithms.hpp @@ -244,7 +244,7 @@ retry: if(contLock.isLocked()) contLock.release(); contLock.lock(cont); cont.fetch(); - } catch(cta::exception::Exception & ex) { + } catch(cta::exception::Exception&) { // The queue is now absent. We can remove its reference in the root entry. // A new queue could have been added in the meantime, and be non-empty. // We will then fail to remove from the RootEntry (non-fatal). @@ -262,7 +262,7 @@ retry: .add("queueObject", cont.getAddressIfSet()) .add("exceptionMessage", ex.getMessageValue()); lc.log(log::INFO, "In ContainerTraits::getLockedAndFetchedNoCreate(): could not dereference missing queue from root entry"); - } catch (RootEntry::NoSuchRetrieveQueue &ex) { + } catch (RootEntry::NoSuchRetrieveQueue&) { // Somebody removed the queue in the meantime. Barely worth mentioning. log::ScopedParamContainer params(lc); params.add("tapeVid", cId) diff --git a/objectstore/Sorter.cpp b/objectstore/Sorter.cpp index 6c28ce3e6c46b7c98393a0a26fa3af516264a5a3..13567afa862fad4a5f5043d01eb3b222fc8f06ac 100644 --- a/objectstore/Sorter.cpp +++ b/objectstore/Sorter.cpp @@ -52,11 +52,11 @@ void Sorter::executeArchiveAlgorithm(const std::string& tapePool, std::string& q for (auto &failedAR : failure.failedElements) { try { std::rethrow_exception(failedAR.failure); - } catch (const cta::exception::NoSuchObject &ex) { + } catch (const cta::exception::NoSuchObject&) { log::ScopedParamContainer params(lc); params.add("fileId", failedAR.element->archiveFile.archiveFileID); lc.log(log::WARNING, "In Sorter::executeArchiveAlgorithm(), queueing impossible, job do not exist in the objectstore."); - } catch (const cta::exception::Exception &e) { + } catch (const cta::exception::Exception&) { uint32_t copyNb = failedAR.element->copyNb; std::get<1>(succeededJobs[copyNb]->jobToQueue).set_exception(std::current_exception()); succeededJobs.erase(copyNb); @@ -178,7 +178,7 @@ void Sorter::executeRetrieveAlgorithm(const std::string& vid, std::string& queue for(auto& failedRR: failure.failedElements){ try { std::rethrow_exception(failedRR.failure); - } catch (const cta::exception::NoSuchObject &ex) { + } catch (const cta::exception::NoSuchObject&) { log::ScopedParamContainer params(lc); params.add("copyNb",failedRR.element->copyNb) .add("fSeq",failedRR.element->fSeq); diff --git a/plugin-manager/PluginInterface.hpp b/plugin-manager/PluginInterface.hpp index a0071eced8deb6e7eaf77850dc06dd254a8ab774..226887c4b6ceba530e0c8d56f6e0b7e782a755ca 100644 --- a/plugin-manager/PluginInterface.hpp +++ b/plugin-manager/PluginInterface.hpp @@ -73,7 +73,7 @@ public: return upType; - } catch (const std::bad_variant_access& e) { + } catch (const std::bad_variant_access&) { throw std::logic_error("Invalid plugin interface."); } }); diff --git a/plugin-manager/PluginManager.hpp b/plugin-manager/PluginManager.hpp index 829b579b23ba7d2a39080675926d4471ce1abe96..b46f5d71af06be8e30a5a87fa7f991949626cffa 100644 --- a/plugin-manager/PluginManager.hpp +++ b/plugin-manager/PluginManager.hpp @@ -191,7 +191,7 @@ private: Loader& loader() { try { return m_umapLoaders.at(m_strActiveLoader); - } catch(const std::out_of_range& oor) { + } catch(const std::out_of_range&) { throw std::runtime_error("Loader " + m_strActiveLoader + " does not exists."); } } diff --git a/scheduler/ArchiveMount.cpp b/scheduler/ArchiveMount.cpp index 234099375297533e10043703072d15d95f7bb69e..b78d70828ff9b8f9fea30eca4a2d9c5a751414f7 100644 --- a/scheduler/ArchiveMount.cpp +++ b/scheduler/ArchiveMount.cpp @@ -376,7 +376,7 @@ void cta::ArchiveMount::setTapeMounted(cta::log::LogContext& logContext) const { auto catalogueTime = t.secs(cta::utils::Timer::resetCounter); spc.add("catalogueTime", catalogueTime); logContext.log(log::INFO, "In ArchiveMount::setTapeMounted(): success."); - } catch (cta::exception::Exception& ex) { + } catch (cta::exception::Exception&) { auto catalogueTimeFailed = t.secs(cta::utils::Timer::resetCounter); spc.add("catalogueTime", catalogueTimeFailed); logContext.log(cta::log::WARNING, "Failed to update catalogue for the tape mounted for archive."); diff --git a/scheduler/OStoreDB/OStoreDB.cpp b/scheduler/OStoreDB/OStoreDB.cpp index e0b2b63a92d012f1041d35e0a0d710659781c6dd..ea51f09a9ff73d7b6ccf4dcd823b7f86d9c2c815 100644 --- a/scheduler/OStoreDB/OStoreDB.cpp +++ b/scheduler/OStoreDB/OStoreDB.cpp @@ -545,7 +545,7 @@ std::unique_ptr OStoreDB::getMountInfo tmdi.m_schedulerGlobalLock.reset(new SchedulerGlobalLock(re.getSchedulerGlobalLock(), m_objectStore)); try { tmdi.m_lockOnSchedulerGlobalLock.lock(*tmdi.m_schedulerGlobalLock, timeout_us); - } catch (cta::exception::TimeoutException& e) { + } catch (cta::exception::TimeoutException&) { auto lockSchedGlobalTime = t.secs(utils::Timer::resetCounter); log::ScopedParamContainer(logContext) .add("rootFetchNoLockTime", rootFetchNoLockTime) @@ -1048,7 +1048,7 @@ void OStoreDB::setArchiveJobBatchReported(std::listasyncDeleteRequest(); - } catch (const cta::exception::NoSuchObject& ex) { + } catch (const cta::exception::NoSuchObject&) { log::ScopedParamContainer(lc) .add("fileId", j->archiveFile.archiveFileID) .log(log::WARNING, @@ -1064,7 +1064,7 @@ void OStoreDB::setArchiveJobBatchReported(std::listwaitAsyncDelete(); - } catch (const cta::exception::NoSuchObject& ex) { + } catch (const cta::exception::NoSuchObject&) { //No need to delete from the completeJobsToDelete list //as it is not used later log::ScopedParamContainer(lc) @@ -1117,7 +1117,7 @@ void OStoreDB::setArchiveJobBatchReported(std::listarchiveFile.archiveFileID) .log(log::WARNING, @@ -1161,7 +1161,7 @@ void OStoreDB::setRetrieveJobBatchReportedToUser(std::listasyncDeleteJob(); - } catch (const cta::exception::NoSuchObject& ex) { + } catch (const cta::exception::NoSuchObject&) { log::ScopedParamContainer(lc) .add("fileId", j->archiveFile.archiveFileID) .log(log::WARNING, "In OStoreDB::setRetrieveJobBatchReportedToUser(): failed to asyncDeleteJob because it does not exist in the objectstore."); @@ -1177,7 +1177,7 @@ void OStoreDB::setRetrieveJobBatchReportedToUser(std::listwaitAsyncDelete(); - } catch (const cta::exception::NoSuchObject& ex) { + } catch (const cta::exception::NoSuchObject&) { log::ScopedParamContainer(lc) .add("fileId", j->archiveFile.archiveFileID) .add("objectAddress", j->m_retrieveRequest.getAddressIfSet()) @@ -1946,7 +1946,7 @@ std::string OStoreDB::blockRetrieveQueueForCleanup(const std::string& vid) { throw RetrieveQueueNotFound("In OStoreDB::blockRetrieveQueueForCleanup(): Retrieve queue of vid " + vid + " not found. " + ex.getMessageValue()); } catch (cta::exception::NoSuchObject& ex) { throw RetrieveQueueNotFound("In OStoreDB::blockRetrieveQueueForCleanup(): Retrieve queue of vid " + vid + " not found. " + ex.getMessageValue()); - } catch (cta::exception::Exception& ex) { + } catch (cta::exception::Exception&) { throw; } @@ -2203,7 +2203,7 @@ void OStoreDB::setRetrieveQueueCleanupFlag(const std::string& vid, bool val, log try { qAddress = re.getRetrieveQueueAddress(vid, common::dataStructures::JobQueueType::JobsToTransferForUser); rqueue.setAddress(qAddress); - } catch (cta::exception::Exception& ex) { + } catch (cta::exception::Exception&) { ScopedExclusiveLock rexl(re); rootRelockExclusiveTime = t.secs(utils::Timer::resetCounter); re.fetch(); @@ -3123,7 +3123,7 @@ copyNbFound:; try { std::shared_ptr rrai(rr->asyncInsert()); asyncInsertionInfoList.emplace_back(AsyncInsertionInfo {rsr, rr, rrai, bestVid, activeCopyNumber}); - } catch (cta::objectstore::ObjectOpsBase::NotNewObject& objExists) { + } catch (cta::objectstore::ObjectOpsBase::NotNewObject&) { //The retrieve subrequest already exists in the objectstore and is not deleted, we log and don't do anything log::ScopedParamContainer(lc) .add("copyNb", activeCopyNumber) @@ -3324,7 +3324,7 @@ void OStoreDB::cancelRepack(const std::string& vid, log::LogContext& lc) { //In the case the owner is not a Repack queue, //the owner is an agent. We remove it from its ownership rr.removeFromOwnerAgentOwnership(); - } catch (const cta::exception::Exception& ex) { + } catch (const cta::exception::Exception&) { //The owner is a queue, so continue } // We now need to dereference, from a queue if needed and from the index for sure. @@ -4122,7 +4122,7 @@ void OStoreDB::RetrieveMount::flushAsyncSuccessReports(std::listwait(); - } catch(cta::exception::NoSuchObject &ex) { + } catch(cta::exception::NoSuchObject&) { // Skip non-existent objects continue; } @@ -201,7 +201,7 @@ getQueueJobs(const jobQueue_t &jobQueueChunk) for(auto &osrr : requests) { try { osrr.second->wait(); - } catch (cta::exception::NoSuchObject &ex) { + } catch (cta::exception::NoSuchObject&) { // Skip non-existent objects continue; } diff --git a/scheduler/RetrieveMount.cpp b/scheduler/RetrieveMount.cpp index 1183e6722822dbe24fa9c3ecc1fe53ccc230913e..681d7a5667754b5188de7d68d321b9d210a43253 100644 --- a/scheduler/RetrieveMount.cpp +++ b/scheduler/RetrieveMount.cpp @@ -515,7 +515,7 @@ void cta::RetrieveMount::setTapeMounted(cta::log::LogContext& logContext) const auto catalogueTime = t.secs(cta::utils::Timer::resetCounter); spc.add("catalogueTime", catalogueTime); logContext.log(log::INFO, "In RetrieveMount::setTapeMounted(): success."); - } catch (cta::exception::Exception& ex) { + } catch (cta::exception::Exception&) { auto catalogueTimeFailed = t.secs(cta::utils::Timer::resetCounter); spc.add("catalogueTime", catalogueTimeFailed); logContext.log(cta::log::WARNING, "Failed to update catalogue for the tape mounted for retrieve."); diff --git a/scheduler/Scheduler.cpp b/scheduler/Scheduler.cpp index 7af326500cf6b131f0e5898d9422be77b6d57dd5..1acec1a69285f070693ee04c335adf53dd9c84b8 100644 --- a/scheduler/Scheduler.cpp +++ b/scheduler/Scheduler.cpp @@ -746,7 +746,7 @@ void Scheduler::expandRepackRequest(const std::unique_ptr& repack //Here, test that the archive route of the copyNb of the tape file is configured try { archiveFileRoutes.at(tc.copyNb); - } catch (const std::out_of_range& ex) { + } catch (const std::out_of_range&) { deleteRepackBuffer(std::move(dir), lc); std::ostringstream oss; oss << "In Scheduler::expandRepackRequest(): the file archiveFileID=" << archiveFile.archiveFileID @@ -2755,7 +2755,7 @@ void Scheduler::updateTapeStateFromPending(const std::string& queueVid, cta::log "change it to its corresponding final state."); } break; } - } catch (const catalogue::UserSpecifiedAWrongPrevState& ex) { + } catch (const catalogue::UserSpecifiedAWrongPrevState&) { auto tapeDataRefreshedUpdated = m_catalogue.Tape()->getTapesByVid(queueVid).at(queueVid); log::ScopedParamContainer paramsWarnMsg(logContext); paramsWarnMsg.add("tapeVid", queueVid) diff --git a/scheduler/rdbms/RelationalDB.cpp b/scheduler/rdbms/RelationalDB.cpp index b05820692dd0c65d8bd5ee81e20ed51a810f10ee..be8824b6f3854bb4d1106d3ffa4270467dfae14b 100644 --- a/scheduler/rdbms/RelationalDB.cpp +++ b/scheduler/rdbms/RelationalDB.cpp @@ -564,7 +564,7 @@ std::list RelationalDB::fetchRepackInfo(cons destInfo.files = rset.columnUint64NoOpt("DESTINATION_ARCHIVED_FILES"); destInfo.bytes = rset.columnUint64NoOpt("DESTINATION_ARCHIVED_BYTES"); repackInfo.destinationInfos.emplace_back(std::move(destInfo)); - } catch (cta::rdbms::NullDbValue& ex) { // pass, the string was Null as there is no destination info + } catch (cta::rdbms::NullDbValue&) { // pass, the string was Null as there is no destination info } } for (auto& kv : repackMap) { @@ -1059,7 +1059,7 @@ RelationalDB::getNextSuccessfulArchiveRepackReportBatch(log::LogContext& lc) { .add("bufferURL", bufferURL) .log(log::INFO, "In RelationalDB::getNextSuccessfulArchiveRepackReportBatch(): deleted the repack buffer directory"); - } catch (const cta::exception::Exception& ex) { + } catch (const cta::exception::Exception&) { log::ScopedParamContainer(lc) .add("bufferURL", bufferURL) .log(log::WARNING, diff --git a/tapeserver/castor/tape/tapeserver/RAO/RAOAlgorithmFactoryFactory.cpp b/tapeserver/castor/tape/tapeserver/RAO/RAOAlgorithmFactoryFactory.cpp index cbe73ca84088d0bd9609c8b42d40ca82cfab0e09..1e2708c72a8edf2550ba2eb942eb3d7d1a34dae6 100644 --- a/tapeserver/castor/tape/tapeserver/RAO/RAOAlgorithmFactoryFactory.cpp +++ b/tapeserver/castor/tape/tapeserver/RAO/RAOAlgorithmFactoryFactory.cpp @@ -38,7 +38,7 @@ std::unique_ptr RAOAlgorithmFactoryFactory::createAlgorithm RAOParams::RAOAlgorithmType raoAlgoType; try { raoAlgoType = raoParams.getAlgorithmType(); - } catch (const cta::exception::Exception & ex) { + } catch (const cta::exception::Exception&) { //We failed to determine the RAOAlgorithmType, we use the linear algorithm by default //log a warning std::string msg = "In RAOAlgorithmFactoryFactory::createAlgorithmFactory(), unable to determine the RAO algorithm to use, the algorithm name provided" diff --git a/tapeserver/castor/tape/tapeserver/daemon/DataTransferSession.cpp b/tapeserver/castor/tape/tapeserver/daemon/DataTransferSession.cpp index 9d873ced89260a53f2b4e4b898adb5c92878c90f..37ca049b2c04d941849cfd33f9b16baf7dd6c750 100644 --- a/tapeserver/castor/tape/tapeserver/daemon/DataTransferSession.cpp +++ b/tapeserver/castor/tape/tapeserver/daemon/DataTransferSession.cpp @@ -90,7 +90,7 @@ castor::tape::tapeserver::daemon::DataTransferSession::execute() { cta::log::LogContext::ScopedParam sp(lc, cta::log::Param("capabilities", cta::server::ProcessCap::getProcText())); lc.log(cta::log::INFO, "DataTransferSession made effective raw I/O capabilty to the tape"); - } catch (const cta::exception::Exception &ex) { + } catch (const cta::exception::Exception&) { lc.log(cta::log::ERR, "DataTransferSession failed to make effective raw I/O capabilty to use tape"); } @@ -172,7 +172,7 @@ castor::tape::tapeserver::daemon::DataTransferSession::execute() { tapeMount = m_scheduler.getNextMount(m_driveConfig.logicalLibrary, m_driveConfig.unitName, lc, m_dataTransferConfig.wdGetNextMountMaxSecs * 1000000); } - } catch (cta::exception::TimeoutException &e) { + } catch (cta::exception::TimeoutException&) { // Print warning and try again, after refreshing the tape drive states cta::log::ScopedParamContainer params(lc); params.add("totalScheduleMountTime", std::to_string(t.secs())); @@ -576,11 +576,11 @@ castor::tape::tapeserver::daemon::DataTransferSession::findDrive(cta::log::LogCo castor::tape::SCSI::DeviceInfo driveInfo; try { driveInfo = dv.findBySymlink(m_driveConfig.devFilename); - } catch (castor::tape::SCSI::DeviceVector::NotFound& e) { + } catch (castor::tape::SCSI::DeviceVector::NotFound&) { // We could not find this drive in the system's SCSI devices putDriveDown("Drive not found on this path", mount, logContext); return nullptr; - } catch (cta::exception::Exception& e) { + } catch (cta::exception::Exception&) { // We could not find this drive in the system's SCSI devices putDriveDown("Error looking for path to tape drive", mount, logContext); return nullptr; @@ -594,7 +594,7 @@ castor::tape::tapeserver::daemon::DataTransferSession::findDrive(cta::log::LogCo drive.reset(castor::tape::tapeserver::drive::createDrive(driveInfo, m_sysWrapper)); if (drive) { drive->config = m_driveConfig; } return drive.release(); - } catch (cta::exception::Exception& e) { + } catch (cta::exception::Exception&) { // We could not find this drive in the system's SCSI devices putDriveDown("Error opening tape drive", mount, logContext); return nullptr; diff --git a/tapeserver/castor/tape/tapeserver/daemon/MigrationReportPacker.cpp b/tapeserver/castor/tape/tapeserver/daemon/MigrationReportPacker.cpp index 91e2c78dab8e36a088ee7b01d986356b5a2315b7..0b264e3d61d24d0cb90be862dc0c12c3f2a99d5c 100644 --- a/tapeserver/castor/tape/tapeserver/daemon/MigrationReportPacker.cpp +++ b/tapeserver/castor/tape/tapeserver/daemon/MigrationReportPacker.cpp @@ -338,7 +338,7 @@ void MigrationReportPacker::ReportFlush::execute(MigrationReportPacker& reportPa auto archiveJob = std::move(failedToReportArchiveJobs.front()); try { archiveJob->failTransfer(ex.getMessageValue(), reportPacker.m_lc); - } catch (const cta::exception::NoSuchObject& nso_ex) { + } catch (const cta::exception::NoSuchObject&) { cta::log::ScopedParamContainer params(reportPacker.m_lc); params.add("fileId", archiveJob->archiveFile.archiveFileID) .add("latestError", archiveJob->latestError) @@ -346,7 +346,7 @@ void MigrationReportPacker::ReportFlush::execute(MigrationReportPacker& reportPa reportPacker.m_lc.log(cta::log::WARNING, "In MigrationReportPacker::ReportFlush::execute(): failed to failTransfer for the " "archive job because it does not exist in the objectstore."); - } catch (const cta::exception::Exception& cta_ex) { + } catch (const cta::exception::Exception&) { //If the failTransfer method fails, we can't do anything about it cta::log::ScopedParamContainer params(reportPacker.m_lc); params.add("fileId", archiveJob->archiveFile.archiveFileID) @@ -364,7 +364,7 @@ void MigrationReportPacker::ReportFlush::execute(MigrationReportPacker& reportPa auto archiveJob = std::move(failedToReportArchiveJobs.front()); try { archiveJob->failReport(ex.getMessageValue(), reportPacker.m_lc); - } catch (const cta::exception::NoSuchObject& nso_ex) { + } catch (const cta::exception::NoSuchObject&) { cta::log::ScopedParamContainer params(reportPacker.m_lc); params.add("fileId", archiveJob->archiveFile.archiveFileID) .add("latestError", archiveJob->latestError) @@ -372,7 +372,7 @@ void MigrationReportPacker::ReportFlush::execute(MigrationReportPacker& reportPa reportPacker.m_lc.log(cta::log::WARNING, "In MigrationReportPacker::ReportFlush::execute(): failed to failReport for the " "archive job because it does not exist in the objectstore."); - } catch (const cta::exception::Exception& cta_ex) { + } catch (const cta::exception::Exception&) { //If the failReport method fails, we can't do anything about it cta::log::ScopedParamContainer params(reportPacker.m_lc); params.add("fileId", archiveJob->archiveFile.archiveFileID) diff --git a/tapeserver/castor/tape/tapeserver/daemon/RecallTaskInjector.cpp b/tapeserver/castor/tape/tapeserver/daemon/RecallTaskInjector.cpp index 6deb873212a0a0bd6a94b1448c0186250dd82bed..bb04c48508dacca6972a413db605a5a861180108 100644 --- a/tapeserver/castor/tape/tapeserver/daemon/RecallTaskInjector.cpp +++ b/tapeserver/castor/tape/tapeserver/daemon/RecallTaskInjector.cpp @@ -408,7 +408,7 @@ void RecallTaskInjector::WorkerThread::run() cta::log::ScopedParamContainer spc(m_parent.m_lc); spc.add("exceptionMessage",e.getMessageValue()); m_parent.m_lc.log(cta::log::INFO, "Error while fetching the limitUDS for RAO enterprise drive. Will run a CTA RAO."); - } catch(const castor::tape::tapeserver::drive::DriveDoesNotSupportRAOException &ex){ + } catch(const castor::tape::tapeserver::drive::DriveDoesNotSupportRAOException&){ m_parent.m_lc.log(cta::log::INFO, "The drive does not support RAO Enterprise, will run a CTA RAO."); } std::optional maxFilesSupportedByRAO = m_parent.m_raoManager.getMaxFilesSupported(); diff --git a/tapeserver/castor/tape/tapeserver/file/EnstoreLargeReadSession.cpp b/tapeserver/castor/tape/tapeserver/file/EnstoreLargeReadSession.cpp index 14193c2fcb72ce28cfe54209c74fea7e9b3941ba..107ab33567671a0b4595b8bc4dcca85d31b957e6 100644 --- a/tapeserver/castor/tape/tapeserver/file/EnstoreLargeReadSession.cpp +++ b/tapeserver/castor/tape/tapeserver/file/EnstoreLargeReadSession.cpp @@ -51,7 +51,7 @@ ReadSession(drive, volInfo, useLbp) { // Tapes should have label character 3, but if they were recycled from CPIO tapes, it could be 0 try { vol1.verify("3"); - } catch (std::exception& e) { + } catch (std::exception&) { try { vol1.verify("0"); } catch (std::exception& e) { diff --git a/tapeserver/castor/tape/tapeserver/file/EnstoreReadSession.cpp b/tapeserver/castor/tape/tapeserver/file/EnstoreReadSession.cpp index 0fda394b2b1c1cbea2de13e5873600f035e342ed..bc68998336034589ab5329eabcbc76490951486e 100644 --- a/tapeserver/castor/tape/tapeserver/file/EnstoreReadSession.cpp +++ b/tapeserver/castor/tape/tapeserver/file/EnstoreReadSession.cpp @@ -49,7 +49,7 @@ EnstoreReadSession::EnstoreReadSession(tapeserver::drive::DriveInterface &drive, // Tapes should have label character 0, but if they were recycled from EnstoreLarge tapes, it could be 3 try { vol1.verify("0"); - } catch (std::exception& e) { + } catch (std::exception&) { try { vol1.verify("3"); } catch (std::exception& e) { diff --git a/tapeserver/castor/tape/tapeserver/file/HeaderChecker.cpp b/tapeserver/castor/tape/tapeserver/file/HeaderChecker.cpp index f59af330f9c9d8b49a5632575dc6cb3c77a2f4bb..cd70a15801a91eb464f08c777d549ef43ed4c071 100644 --- a/tapeserver/castor/tape/tapeserver/file/HeaderChecker.cpp +++ b/tapeserver/castor/tape/tapeserver/file/HeaderChecker.cpp @@ -150,7 +150,7 @@ std::string HeaderChecker::checkVolumeLabel(tapeserver::drive::DriveInterface &d // But if tapes are recycled from one format to the other, it could be flipped try { vol1.verify("0"); - } catch (std::exception& e) { + } catch (std::exception&) { try { vol1.verify("3"); } catch (std::exception& e) { diff --git a/tapeserver/castor/tape/tapeserver/system/FileWrappers.cpp b/tapeserver/castor/tape/tapeserver/system/FileWrappers.cpp index 53312e3e07ac830ad4d27564295795878f990731..4b8743d59cc9a3db06aabea664c26daacd54cd16 100644 --- a/tapeserver/castor/tape/tapeserver/system/FileWrappers.cpp +++ b/tapeserver/castor/tape/tapeserver/system/FileWrappers.cpp @@ -67,7 +67,7 @@ ssize_t System::regularFile::read(void* buf, size_t nbytes) ret = m_content.copy((char *) buf, nbytes, m_read_pointer); m_read_pointer += ret; return ret; - } catch (std::out_of_range & e) { + } catch (std::out_of_range&) { return 0; } } @@ -77,9 +77,9 @@ ssize_t System::regularFile::write(const void *buf, size_t nbytes) try { m_content.assign((const char *) buf, nbytes); return nbytes; - } catch (std::length_error & e) { + } catch (std::length_error&) { return -1; - } catch (std::bad_alloc & e) { + } catch (std::bad_alloc&) { return -1; } } @@ -95,7 +95,6 @@ System::stDeviceFile::stDeviceFile() m_mtStat.mt_dsreg = (((256 * 0x400) & MT_ST_BLKSIZE_MASK) << MT_ST_BLKSIZE_SHIFT) | ((1 & MT_ST_DENSITY_MASK) << MT_ST_DENSITY_SHIFT); m_mtStat.mt_gstat = GMT_EOT(~0) | GMT_BOT(~0); - } int System::stDeviceFile::ioctl(unsigned long int request, struct mtop * mt_cmd) diff --git a/tapeserver/readtp/ReadtpCmd.cpp b/tapeserver/readtp/ReadtpCmd.cpp index 8c1d9083475ed9808b322edcccab46bb76f1f76b..0e2f8b91101bd61a9889cde51e192f97b512207b 100644 --- a/tapeserver/readtp/ReadtpCmd.cpp +++ b/tapeserver/readtp/ReadtpCmd.cpp @@ -604,7 +604,7 @@ void ReadtpCmd::disableEncryption(castor::tape::tapeserver::drive::DriveInterfac if (m_encryptionControl->disable(drive)) { m_log(cta::log::INFO, "Turned encryption off before unmounting"); } - } catch (cta::exception::Exception& ex) { + } catch (cta::exception::Exception&) { m_log(cta::log::ERR, "Failed to turn off encryption before unmounting"); } } diff --git a/tapeserver/readtp/TapeFseqRange.cpp b/tapeserver/readtp/TapeFseqRange.cpp index 724b9f9e654c660f45da578fe344287cd8eb1efc..894d934c1f759bab510cf2ac43ff482dced4b6f2 100644 --- a/tapeserver/readtp/TapeFseqRange.cpp +++ b/tapeserver/readtp/TapeFseqRange.cpp @@ -138,7 +138,7 @@ std::ostream &operator<<(std::ostream &os, } else { os << "END"; } - } catch(cta::exception::Exception &ex) { + } catch(cta::exception::Exception&) { os << "ERROR"; } }