1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-07-29 08:21:15 +03:00

MCOL-520. Made the error msgs users will hit more informative.

This commit is contained in:
Patrick LeBlanc
2018-10-04 16:17:28 -05:00
parent f97dec3406
commit f54cc0803a
2 changed files with 18 additions and 5 deletions

View File

@ -96,7 +96,8 @@ bool getshm(const string &name, int size, bi::shared_memory_object &target) {
}
else {
ostringstream os;
os << "ProcMon failed to create the 'proc stat' shared mem segment, got " << biex.what();
os << "ProcMon failed to create the '" << name << "' shared mem segment, got " << biex.what() << ".";
os << " Check the permissions on /dev/shm; should be 1777";
log.writeLog(__LINE__, os.str(), LOG_TYPE_CRITICAL);
exit(1);
}

View File

@ -166,13 +166,25 @@ RWLockShmImpl::RWLockShmImpl(int key, bool excl)
new (&fState->sems[RWLock::READERS]) bi::interprocess_semaphore(0);
new (&fState->sems[RWLock::WRITERS]) bi::interprocess_semaphore(0);
}
catch (bi::interprocess_exception&)
catch (bi::interprocess_exception &e)
{
if (excl)
if (e.get_error_code() == bi::security_error) {
cerr << "RWLock: Failed to create the lock. Check perms on /dev/shm; should be 1777" << endl;
throw;
}
if (e.get_error_code() == bi::already_exists_error && excl)
throw not_excl();
if (e.get_error_code() != bi::already_exists_error)
throw;
try {
bi::shared_memory_object shm(bi::open_only, keyName.c_str(), bi::read_write);
fStateShm.swap(shm);
}
catch (exception &e) {
cerr << "RWLock failed to attach to the " << keyName << " shared mem segment, got " << e.what() << endl;
throw;
}
bi::mapped_region region(fStateShm, bi::read_write);
fRegion.swap(region);
fState = static_cast<State*>(fRegion.get_address());