Hi Mateusz, The Client object creates a Hyperspace session which is conflicting with the one you're creating in main().
- Doug On Sat, May 16, 2009 at 8:37 AM, Mateusz Berezecki <[email protected]>wrote: > > Hi list, > > Can someone please tell me why this code prints > > 1242487951 WARN usage_report : > (/Users/m/hypertable/src/cc/Hyperspace/ClientConnectionHandler.h:65) > Connection attempt to Hyperspace.Master at 127.0.0.1:38040 - COMM > already connected > > after wait_for_connection is called and hangs on open() call ? > > int main(int argc, char *argv[]) > { > ClientPtr client = new Client(System::locate_install_dir(argv[0])); > > HyperspaceCallback callback; > Hyperspace::SessionPtr session(new > Hyperspace::Session(Comm::instance(), properties, &callback)); > session->wait_for_connection(2000); > > vector<String> tables; > vector<String>::const_iterator it; > client->get_tables(tables); > > for (it = tables.begin(); it != tables.end(); ++it) { > TablePtr t = client->open_table(*it); > > string table_file = "/hypertable/tables/"; table_file += *it; > > HandleCallbackPtr null_callback; > uint64_t handle = session->open(table_file, OPEN_FLAG_WRITE | > OPEN_FLAG_LOCK_EXCLUSIVE, null_callback); > > session->close(handle); > } > } > > ? > > The stack trace is: > > #0 0x908123ae in __semwait_signal () > #1 0x9083d326 in _pthread_cond_wait () > #2 0x9083cd0d in pthread_cond_wait$UNIX2003 () > #3 0x0000d3bc in > boost::condition_variable_any::wait<boost::unique_lock<boost::mutex> > > (this=0xb0caa4, m...@0xbffff2c8) at condition_variable.hpp:84 > #4 0x000d8cc1 in Hyperspace::Session::wait_for_safe (this=0xb0ca70) > at /Users/m/hypertable/src/cc/Hyperspace/Session.cc:771 > #5 0x000e069d in Hyperspace::Session::open (this=0xb0ca70, > handle_sta...@0xbffff458, cbuf_p...@0xbffff448, timer=0x0) at > /Users/m/hypertable/src/cc/Hyperspace/Session.cc:96 > #6 0x000e0d36 in Hyperspace::Session::open (this=0xb0ca70, > na...@0xbffff4bc, flags=134, callba...@0xbffff4b8, timer=0x0) at > /Users/m/hypertable/src/cc/Hyperspace/Session.cc:139 > #7 0x00005aca in main (argc=1, argv=0xbffff530) at > /Users/m/hypertable/src/cc/Tools/usage_report/usage_report.cc:49 > > it suggests that the session never enters SAFE state? What's wrong > with my code above? > > Mateusz > > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Hypertable Development" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/hypertable-dev?hl=en -~----------~----~----~----~------~----~------~--~---
