Skip to content

Commit 7ca4672

Browse files
committed
chore: remove unrelated SHM changes from compose PR
1 parent 401052b commit 7ca4672

2 files changed

Lines changed: 16 additions & 153 deletions

File tree

concore.hpp

Lines changed: 16 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -632,14 +632,8 @@ class Concore{
632632
}
633633
}
634634

635-
catch (const std::exception &e) {
636-
// Surface the error message and rethrow so callers (or the runtime)
637-
// see the failure instead of silently proceeding with truncated data.
638-
std::cerr << e.what() << std::endl;
639-
throw;
640-
} catch (...) {
641-
// Unknown exception: rethrow to avoid silent suppression.
642-
throw;
635+
catch(...){
636+
cout<<"skipping +"<<outpath<<port<<" /"<<name;
643637
}
644638
}
645639

@@ -663,11 +657,8 @@ class Concore{
663657
}
664658
else throw 505;
665659
}
666-
catch (const std::exception &e) {
667-
std::cerr << e.what() << std::endl;
668-
throw;
669-
} catch (...) {
670-
throw;
660+
catch(...){
661+
cout<<"skipping +"<<outpath<<port<<" /"<<name;
671662
}
672663
}
673664

@@ -692,13 +683,9 @@ class Concore{
692683
outfile<<val[val.size()-1]<<']';
693684
std::string result = outfile.str();
694685
if (result.size() >= SHM_SIZE) {
695-
throw std::runtime_error(
696-
"concore SHM write failed: payload (" +
697-
std::to_string(result.size()) +
698-
" bytes) exceeds SHM_SIZE (" +
699-
std::to_string(SHM_SIZE) +
700-
"). Aborting. No data written. Increase SHM_SIZE in concore.hpp."
701-
);
686+
std::cerr << "ERROR: write_SM payload (" << result.size()
687+
<< " bytes) exceeds " << SHM_SIZE - 1
688+
<< "-byte shared memory limit. Data truncated!" << std::endl;
702689
}
703690
std::strncpy(sharedData_create, result.c_str(), SHM_SIZE - 1);
704691
sharedData_create[SHM_SIZE - 1] = '\0';
@@ -709,11 +696,8 @@ class Concore{
709696
}
710697
}
711698

712-
catch (const std::exception &e) {
713-
std::cerr << e.what() << std::endl;
714-
throw;
715-
} catch (...) {
716-
throw;
699+
catch(...){
700+
cout<<"skipping +"<<outpath<<port<<" /"<<name;
717701
}
718702
}
719703

@@ -727,29 +711,22 @@ class Concore{
727711
void write_SM(int port, string name, string val, int delta=0){
728712
chrono::milliseconds timespan((int)(2000*delay));
729713
this_thread::sleep_for(timespan);
730-
if (val.size() >= SHM_SIZE) {
731-
throw std::runtime_error(
732-
"concore SHM write failed: payload (" +
733-
std::to_string(val.size()) +
734-
" bytes) exceeds SHM_SIZE (" +
735-
std::to_string(SHM_SIZE) +
736-
"). Aborting. No data written. Increase SHM_SIZE in concore.hpp."
737-
);
738-
}
739714
try {
740715
if(shmId_create != -1){
741716
if (sharedData_create == nullptr)
742717
throw 506;
718+
if (val.size() >= SHM_SIZE) {
719+
std::cerr << "ERROR: write_SM payload (" << val.size()
720+
<< " bytes) exceeds " << SHM_SIZE - 1
721+
<< "-byte shared memory limit. Data truncated!" << std::endl;
722+
}
743723
std::strncpy(sharedData_create, val.c_str(), SHM_SIZE - 1);
744724
sharedData_create[SHM_SIZE - 1] = '\0';
745725
}
746726
else throw 505;
747727
}
748-
catch (const std::exception &e) {
749-
std::cerr << e.what() << std::endl;
750-
throw;
751-
} catch (...) {
752-
throw;
728+
catch(...){
729+
cout<<"skipping +"<<outpath<<port<<" /"<<name;
753730
}
754731
}
755732

tests/test_shm_abort.py

Lines changed: 0 additions & 114 deletions
This file was deleted.

0 commit comments

Comments
 (0)