comparison Framework/Oracle/ThreadedOracle.cpp @ 956:a7351ad54960

Made IsContextLost automatically set the flag by checking with the emscripten WebGL wrapper + added a LOT of logging messages right before throwing ErrorCode_BadSequenceOfCalls exceptions + increased the http request timeouts from 60 to 600 sec (big datasets in some recent customer use cases) + added IsContext lost through the Viewport/Context layer (to make it reachable from external API) + the same for the underlying device context (for debug)
author Benjamin Golinvaux <bgo@osimis.io>
date Wed, 21 Aug 2019 16:16:30 +0200
parents a68cd7ae8838
children 18d53a8b41b7
comparison
equal deleted inserted replaced
953:118fc5c85d07 956:a7351ad54960
454 { 454 {
455 boost::mutex::scoped_lock lock(mutex_); 455 boost::mutex::scoped_lock lock(mutex_);
456 456
457 if (state_ != State_Setup) 457 if (state_ != State_Setup)
458 { 458 {
459 LOG(ERROR) << "ThreadedOracle::SetOrthancParameters(): (state_ != State_Setup)";
459 throw Orthanc::OrthancException(Orthanc::ErrorCode_BadSequenceOfCalls); 460 throw Orthanc::OrthancException(Orthanc::ErrorCode_BadSequenceOfCalls);
460 } 461 }
461 else 462 else
462 { 463 {
463 orthanc_ = orthanc; 464 orthanc_ = orthanc;
473 { 474 {
474 throw Orthanc::OrthancException(Orthanc::ErrorCode_ParameterOutOfRange); 475 throw Orthanc::OrthancException(Orthanc::ErrorCode_ParameterOutOfRange);
475 } 476 }
476 else if (state_ != State_Setup) 477 else if (state_ != State_Setup)
477 { 478 {
479 LOG(ERROR) << "ThreadedOracle::SetThreadsCount(): (state_ != State_Setup)";
478 throw Orthanc::OrthancException(Orthanc::ErrorCode_BadSequenceOfCalls); 480 throw Orthanc::OrthancException(Orthanc::ErrorCode_BadSequenceOfCalls);
479 } 481 }
480 else 482 else
481 { 483 {
482 workers_.resize(count); 484 workers_.resize(count);
492 { 494 {
493 throw Orthanc::OrthancException(Orthanc::ErrorCode_ParameterOutOfRange); 495 throw Orthanc::OrthancException(Orthanc::ErrorCode_ParameterOutOfRange);
494 } 496 }
495 else if (state_ != State_Setup) 497 else if (state_ != State_Setup)
496 { 498 {
499 LOG(ERROR) << "ThreadedOracle::SetSleepingTimeResolution(): (state_ != State_Setup)";
497 throw Orthanc::OrthancException(Orthanc::ErrorCode_BadSequenceOfCalls); 500 throw Orthanc::OrthancException(Orthanc::ErrorCode_BadSequenceOfCalls);
498 } 501 }
499 else 502 else
500 { 503 {
501 sleepingTimeResolution_ = milliseconds; 504 sleepingTimeResolution_ = milliseconds;
507 { 510 {
508 boost::mutex::scoped_lock lock(mutex_); 511 boost::mutex::scoped_lock lock(mutex_);
509 512
510 if (state_ != State_Setup) 513 if (state_ != State_Setup)
511 { 514 {
515 LOG(ERROR) << "ThreadedOracle::Start(): (state_ != State_Setup)";
512 throw Orthanc::OrthancException(Orthanc::ErrorCode_BadSequenceOfCalls); 516 throw Orthanc::OrthancException(Orthanc::ErrorCode_BadSequenceOfCalls);
513 } 517 }
514 else 518 else
515 { 519 {
516 state_ = State_Running; 520 state_ = State_Running;