Closed hguemar closed 10 years ago
test failed with boost 1.46.1.
The fail occured at core/src/util/sessionUtil.cpp:146 bi::file_lock sessionLock(file);
Exception raised ./bin/vishnu_connect: No such file or directory To get help, try << ./bin/vishnu_connect -h >>
rebased against current zmq branch
What about this PR? It doesn't work with boost 1.49.
I rebased the PR and tested it on morgane against boost 1.46.1, you can reproduce it there using the following steps:
git clone https://github.com/hguemar/vishnu
git checkout zmq
mkdir build && cd build
ccmake28 -DBOOST_ROOT=/opt/boost146 ..
make -j12
Ne marche toujours pas chez moi avec boost 1.49 et ubuntu 12.04 Quand j'applique le patch : ./bin/vishnu_connect: No such file or directory To get help, try << ./bin/vishnu_connect -h >>
_Je ne sais pas si c'est spécifique à ma machine. _
Tu peux essayer sur morgane, j'ai également rajouté Boost 1.49 (/opt/boost149), j'arrive à lancer un umssed et me connecter à vishnu.
c'est certainement mon système, mais je ne saurais expliquer.
je tente sur une VM morgane
Testé sur une VM ubuntu 12.04.3 fraiche avec Boost 1.49, ça passe :/
After further investigations the problem persists. Howeber, I can note that the code lacks of exception handling, notably for boost::interprocess::interprocess_exception.
When I add a try ... catch block as below, it seems that the connection succeed, but due to the lack of exception handling the program fails.
After this change :
./bin/vishnu_connect
No such file or directory
sessionId: root-2014-Jan-16-11:18:02.921430:31905
Snippet
template <class T>
void
saveIntoFile(SessionContainer& allSessions, const char* file){
try {
bi::file_lock sessionLock(file);
bi::scoped_lock<bi::file_lock> lock(sessionLock);
std::ofstream ofile (file);
T ar(ofile);
ar << bs::make_nvp("sessions",allSessions);
ofile.close();
} catch (const bi::interprocess_exception& ex) {
std::cout << ex.what() <<"\n";
}
Thank you for your insight, i'll modify the PR in that way.
ok, merged
add a file lock to disable concurrent accesses to ~/.vishun/sessions/
file fixes #135