thrift-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Randy Abernethy <randy.aberne...@gmail.com>
Subject Re: Getting IllegalStateException in thrift server
Date Tue, 03 Sep 2013 20:18:16 GMT
Hello Vivek,

Once the ThreadManager::Impl is stopped you can not restart it. Is it
possible that the ThreadManager::Impl::stopImpl() method was called prior
to the code you show? If so you will need to destroy the old thread_manager
and create a new one for the next server run.

You can call the ThreadManager::state() method before and after the call to
start() to see what is happening.


  thread_manager->threadFactory(threadfactory);
  std::cout << thread_manager->state();  << std::endl; //or some such
  thread_manager->start();
  std::cout << thread_manager->state();  << std::endl;
  server = new TNonblockingServer(processor, protocolfactory,
                                   port,
                                   thread_manager);
  server->serve();


Best,
Randy



On Tue, Sep 3, 2013 at 12:40 AM, Vivek Goel <goelvivek2011@gmail.com> wrote:

> I am using thrift C++ library.
>
> My code look like:
>
>   thread_manager->threadFactory(threadfactory);
>   thread_manager->start();
>   server = new TNonblockingServer(processor, protocolfactory,
>                                    port,
>                                    thread_manager);
>   server->serve();
>
>
> Sometimes, while starting the process. I am getting following error:
>
> Thrift: Tue Sep 3 06:54:47 2013 IllegalStateException: Server::process()
> ThreadManager::Impl::add ThreadManager not started
>
>
> regards
> Vivek Goel
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message