I got this error in a Symfony custom console command:
ErrorException: Warning: ini_set(): Headers already sent. You cannot change the session module's ini settings at this time in <PROJECT_DIR>/backend/vendor/symfony/http-foundation/Session/Storage/Handler/NativeFile
The error was generated by a Doctrine ORM query and the problem is repeatable.
First things first, I suggested to update Symfony from 4.4.2 version to 4.4.20, but it doesn't seem doable in the short term.
I found this issue on Symfony project's git:
https://github.com/symfony/symfony/issues/29605
but I cannot find a doctrine listener in my code that use SessionInterface, so I'm in a dead end.
Do you have any ideas how I can fix this console command without rewrite all from scratch?
This is the stacktrace:
ErrorException: Warning: ini_set(): Headers already sent. You cannot change the session module's ini settings at this time in <PROJECT_DIR>/backend/vendor/symfony/http-foundation/Session/Storage/Handler/NativeFile
SessionHandler.php:52 Stack trace:
#0 <PROJECT_DIR>/backend/var/cache/prod/Container0iTkVVw/srcApp_KernelProdDebugContainer.php(1367): Symfony\Component\HttpFoundation\Session\Storage\Handler\NativeFileSessionHandler->__construct('<PROJECT_DIR>...')
#1 <PROJECT_DIR>/backend/var/cache/prod/Container0iTkVVw/srcApp_KernelProdDebugContainer.php(1823): Container0iTkVVw\srcApp_KernelProdDebugContainer->getSessionService()
#2 <PROJECT_DIR>/backend/vendor/symfony/dependency-injection/Container.php(444): Container0iTkVVw\srcApp_KernelProdDebugContainer->getApp_Context_ListenerService()
#3 <PROJECT_DIR>/backend/vendor/symfony/dependency-injection/Argument/ServiceLocator.php(40): Symfony\Component\DependencyInjection\Container->getService('privates', 'app.context.lis...', 'getApp_Context_...', false)
#4 <PROJECT_DIR>/backend/vendor/symfony/doctrine-bridge/ContainerAwareEventManager.php(136): Symfony\Component\DependencyInjection\Argument\ServiceLocator->get('app.context.lis...')
#5 <PROJECT_DIR>/backend/vendor/symfony/doctrine-bridge/ContainerAwareEventManager.php(74): Symfony\Bridge\Doctrine\ContainerAwareEventManager->initializeListeners('prePersist')
#6 <PROJECT_DIR>/backend/vendor/gedmo/doctrine-extensions/lib/Gedmo/SoftDeleteable/Filter/SoftDeleteableFilter.php(95): Symfony\Bridge\Doctrine\ContainerAwareEventManager->getListeners()
#7 <PROJECT_DIR>/backend/vendor/gedmo/doctrine-extensions/lib/Gedmo/SoftDeleteable/Filter/SoftDeleteableFilter.php(51): Gedmo\SoftDeleteable\Filter\SoftDeleteableFilter->getListener()
#8 <PROJECT_DIR>/backend/vendor/doctrine/orm/lib/Doctrine/ORM/Query/SqlWalker.php(508): Gedmo\SoftDeleteable\Filter\SoftDeleteableFilter->addFilterConstraint(Object(Doctrine\ORM\Mapping\ClassMetadata), 'm0_')
#9 <PROJECT_DIR>/backend/vendor/doctrine/orm/lib/Doctrine/ORM/Query/SqlWalker.php(1786): Doctrine\ORM\Query\SqlWalker->generateFilterConditionSQL(Object(Doctrine\ORM\Mapping\ClassMetadata), 'm0_')
#10 <PROJECT_DIR>/backend/vendor/doctrine/orm/lib/Doctrine/ORM/Query/SqlWalker.php(526): Doctrine\ORM\Query\SqlWalker->walkWhereClause(Object(Doctrine\ORM\Query\AST\WhereClause))
#11 <PROJECT_DIR>/backend/vendor/doctrine/orm/lib/Doctrine/ORM/Query/Exec/SingleSelectExecutor.php(42): Doctrine\ORM\Query\SqlWalker->walkSelectStatement(Object(Doctrine\ORM\Query\AST\SelectStatement))
#12 <PROJECT_DIR>/backend/vendor/doctrine/orm/lib/Doctrine/ORM/Query/SqlWalker.php(278): Doctrine\ORM\Query\Exec\SingleSelectExecutor->__construct(Object(Doctrine\ORM\Query\AST\SelectStatement), Object(Doctrine\ORM\Query\SqlWalker))
#13 <PROJECT_DIR>/backend/vendor/doctrine/orm/lib/Doctrine/ORM/Query/Parser.php(399): Doctrine\ORM\Query\SqlWalker->getExecutor(Object(Doctrine\ORM\Query\AST\SelectStatement))
#14 <PROJECT_DIR>/backend/vendor/doctrine/orm/lib/Doctrine/ORM/Query.php(286): Doctrine\ORM\Query\Parser->parse()
#15 <PROJECT_DIR>/backend/vendor/doctrine/orm/lib/Doctrine/ORM/Query.php(298): Doctrine\ORM\Query->_parse()
#16 <PROJECT_DIR>/backend/vendor/doctrine/orm/lib/Doctrine/ORM/AbstractQuery.php(992): Doctrine\ORM\Query->_doExecute()
#17 <PROJECT_DIR>/backend/vendor/doctrine/orm/lib/Doctrine/ORM/AbstractQuery.php(947): Doctrine\ORM\AbstractQuery->executeIgnoreQueryCache(NULL, 1)
#18 <PROJECT_DIR>/backend/vendor/doctrine/orm/lib/Doctrine/ORM/AbstractQuery.php(750): Doctrine\ORM\AbstractQuery->execute(NULL, 1)
#19 <PROJECT_DIR>/backend/src/Repository/MemberRepository.php(320): Doctrine\ORM\AbstractQuery->getResult()
#20 <PROJECT_DIR>/backend/src/Services/SyncActiveCampaignManager.php(604): App\Repository\MemberRepository->findByExtactFiscalCode('XXXXXXXXXXXXXXX...')
#21 <PROJECT_DIR>/backend/src/Services/SyncActiveCampaignManager.php(565): App\Services\SyncActiveCampaignManager->syncSingleACContacts(Array, Array)
#22 <PROJECT_DIR>/backend/src/Command/SyncActiveCampaignCommand.php(118): App\Services\SyncActiveCampaignManager->syncExistingACContacts(Array, Array, 10)
#23 <PROJECT_DIR>/backend/vendor/symfony/console/Command/Command.php (251): App\Command\SyncActiveCampaignCommand->execute(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#24 <PROJECT_DIR>/backend/vendor/symfony/console/Application.php(904): Symfony\Component\Console\Command\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#25 <PROJECT_DIR>/backend/vendor/symfony/framework-bundle/Console/Application.php(89): Symfony\Component\Console\Application->doRunCommand(Object(App\Command\SyncActiveCampaignCommand), Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#26 <PROJECT_DIR>/backend/vendor/symfony/console/Application.php(262): Symfony\Bundle\FrameworkBundle\Console\Application->doRunCommand(Object(App\Command\SyncActiveCampaignCommand), Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#27 <PROJECT_DIR>/backend/vendor/symfony/framework-bundle/Console/Application.php(75): Symfony\Component\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#28 <PROJECT_DIR>/backend/vendor/symfony/console/Application.php(145): Symfony\Bundle\FrameworkBundle\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#29 <PROJECT_DIR>/backend/bin/console(39): Symfony\Component\Console\Application->run(Object(Symfony\Component\Console\Input\ArgvInput))
#30 {main} [] []
I implemented a multi-thread asynchronous service based on https://github.com/grpc/grpc/blob/master/examples/cpp/helloworld/greeter_async_client2.cc . I have 64 threads doing some execution and then contact the remote server in asynchronous manner. However, when I ran my code, usually it will stuck on pthread_join of some threads, and sometimes both of my node can successfully do pthread_join on all my worker threads and some times only one node can do that. I later ran info thread at the point of stuck and there is the result I get from it.
* 1 Thread 0x7ffff7fe2100 (LWP 10567) "rundb" 0x00007ffff64f4d2d in __GI___pthread_timedjoin_ex (threadid=140732532782848, thread_return=0x0, abstime=0x0,
block=<optimized out>) at pthread_join_common.c:89
2 Thread 0x7ffff55ff700 (LWP 10568) "rundb" 0x00007ffff64f99f3 in futex_wait_cancelable (private=<optimized out>, expected=0, futex_word=0x7ffff4134118)
at ../sysdeps/unix/sysv/linux/futex-internal.h:88
3 Thread 0x7ffff4dfe700 (LWP 10569) "rundb" 0x00007ffff621cbb7 in epoll_wait (epfd=25, events=0x7ffff3c446b0, maxevents=100, timeout=-1)
at ../sysdeps/unix/sysv/linux/epoll_wait.c:30
4 Thread 0x7ffff3bff700 (LWP 10570) "default-executo" 0x00007ffff64f99f3 in futex_wait_cancelable (private=<optimized out>, expected=0,
futex_word=0x7ffff4108064)
at ../sysdeps/unix/sysv/linux/futex-internal.h:88
5 Thread 0x7ffff33fe700 (LWP 10571) "resolver-execut" 0x00007ffff64f99f3 in futex_wait_cancelable (private=<optimized out>, expected=0,
futex_word=0x7ffff410b860)
at ../sysdeps/unix/sysv/linux/futex-internal.h:88
6 Thread 0x7ffff17ff700 (LWP 10572) "grpc_global_tim" 0x00007ffff64f99f3 in futex_wait_cancelable (private=<optimized out>, expected=0,
futex_word=0xd5a668 <g_cv_wait+40>)
at ../sysdeps/unix/sysv/linux/futex-internal.h:88
7 Thread 0x7ffff07fd700 (LWP 10574) "grpc_health_che" 0x00007ffff64f99f3 in---Type <return> to continue, or q <return> to quit---ret
futex_wait_cancelable (private=<optimized out>, expected=0,
futex_word=0x7ffff07fb1e8)
at ../sysdeps/unix/sysv/linux/futex-internal.h:88
8 Thread 0x7ffff0ffe700 (LWP 10573) "grpc_health_che" 0x00007ffff64f99f3 in futex_wait_cancelable (private=<optimized out>, expected=0,
futex_word=0x7ffff0ffc1e8)
at ../sysdeps/unix/sysv/linux/futex-internal.h:88
9 Thread 0x7fffef7fb700 (LWP 10575) "grpcpp_sync_ser" 0x00007ffff64f9ed9 in futex_reltimed_wait_cancelable (private=<optimized out>,
reltime=0x7fffef7f8f60, expected=0, futex_word=0x7fffef7f90d8)
at ../sysdeps/unix/sysv/linux/futex-internal.h:142
27 Thread 0x7fffcdbff700 (LWP 10594) "grpc_global_tim" 0x00007ffff64f9ed9 in futex_reltimed_wait_cancelable (private=<optimized out>,
reltime=0x7fffcdbfd2d0, expected=0, futex_word=0xd5a668 <g_cv_wait+40>)
at ../sysdeps/unix/sysv/linux/futex-internal.h:142
41 Thread 0x7ffed89ff700 (LWP 10608) "rundb" 0x00007ffff64f99f3 in futex_wait_cancelable (private=<optimized out>, expected=0, futex_word=0x7ffed89fcfb0)
at ../sysdeps/unix/sysv/linux/futex-internal.h:88
81 Thread 0x7ffec49d7700 (LWP 10648) "rundb" 0x00007ffff64f99f3 in futex_wait_cancelable (private=<optimized out>, expected=0, futex_word=0x7ffec49d4fb0)
at ../sysdeps/unix/sysv/linux/futex-internal.h:88
83 Thread 0x7ffec39d5700 (LWP 10650) "rundb" 0x00007ffff621cbb7 in epoll_wait (epfd=3, events=0x7ffff404c2b0, maxevents=100, timeout=-1)
---Type <return> to continue, or q <return> to quit---ret
at ../sysdeps/unix/sysv/linux/epoll_wait.c:30
91 Thread 0x7ffebf9cd700 (LWP 10658) "rundb" 0x0000000000429e7f in LogManager::run (this=0x7ffff5a3a1e0) at storage/log.cpp:79
152 Thread 0x7ffeb81fd700 (LWP 10719) "default-executo" 0x00007ffff64f99f3 in futex_wait_cancelable (private=<optimized out>, expected=0,
futex_word=0x7ffff410810c)
at ../sysdeps/unix/sysv/linux/futex-internal.h:88
545 Thread 0x7ffeb9fff700 (LWP 11112) "default-executo" 0x00007ffff64f99f3 in futex_wait_cancelable (private=<optimized out>, expected=0,
futex_word=0x7ffff41081b0)
at ../sysdeps/unix/sysv/linux/futex-internal.h:88
682 Thread 0x7fffefffc700 (LWP 11249) "default-executo" 0x00007ffff64f99f3 in futex_wait_cancelable (private=<optimized out>, expected=0,
futex_word=0x7ffff4108258)
at ../sysdeps/unix/sysv/linux/futex-internal.h:88
1397 Thread 0x7fffccbff700 (LWP 11964) "default-executo" 0x00007ffff64f99f3 in futex_wait_cancelable (private=<optimized out>, expected=0,
futex_word=0x7ffff4108300)
at ../sysdeps/unix/sysv/linux/futex-internal.h:88
3470 Thread 0x7ffeb89fe700 (LWP 14041) "default-executo" 0x00007ffff64f99f3 in futex_wait_cancelable (private=<optimized out>, expected=0,
futex_word=0x7ffff41083a8)
at ../sysdeps/unix/sysv/linux/futex-internal.h:88
---Type <return> to continue, or q <return> to quit---re
4766 Thread 0x7ffeb91ff700 (LWP 15337) "default-executo" 0x00007ffff64f99f3 in futex_wait_cancelable (private=<optimized out>, expected=0,
futex_word=0x7ffff4108450)
at ../sysdeps/unix/sysv/linux/futex-internal.h:88
7122 Thread 0x7ffe9f8ff700 (LWP 17693) "default-executo" 0x00007ffff64f99f3 in futex_wait_cancelable (private=<optimized out>, expected=0,
futex_word=0x7ffff41084f8)
at ../sysdeps/unix/sysv/linux/futex-internal.h:88
7132 Thread 0x7ffeacdff700 (LWP 17703) "grpcpp_sync_ser" 0x00007ffff64f9ed9 in futex_reltimed_wait_cancelable (private=<optimized out>,
reltime=0x7ffeacdfce90, expected=0, futex_word=0x7ffeacdfd050)
at ../sysdeps/unix/sysv/linux/futex-internal.h:142
7135 Thread 0x7ffe651ff700 (LWP 17706) "grpcpp_sync_ser" 0x00007ffff621cbb7 in epoll_wait (epfd=14, events=0x7ffedb88a0b0, maxevents=100, timeout=9992)
at ../sysdeps/unix/sysv/linux/epoll_wait.c:30
I compared it with the results of successfully joined program and I found the major issues are 41, 81 and 83. Then I did thread 41, thread 81 and thread 83 and I get the followings.
thread 41
#0 0x00007ffff64f99f3 in futex_wait_cancelable (private=<optimized out>,
expected=0, futex_word=0x7ffed89fcfb0)
at ../sysdeps/unix/sysv/linux/futex-internal.h:88
#1 __pthread_cond_wait_common (abstime=0x0, mutex=0x7ffff404c278,
cond=0x7ffed89fcf88) at pthread_cond_wait.c:502
#2 __pthread_cond_wait (cond=0x7ffed89fcf88, mutex=0x7ffff404c278)
at pthread_cond_wait.c:655
#3 0x000000000072f05a in gpr_cv_wait ()
#4 0x00000000006a12b0 in begin_worker ()
#5 0x00000000006a1757 in pollset_work ()
#6 0x000000000067dd5a in pollset_work(grpc_pollset*, grpc_pollset_worker**, long) ()
#7 0x00000000005219ea in grpc_pollset_work(grpc_pollset*, grpc_pollset_worker**, long) ()
#8 0x000000000054fa23 in cq_next(grpc_completion_queue*, gpr_timespec, void*)
()
#9 0x000000000054ff18 in grpc_completion_queue_next ()
#10 0x0000000000470676 in grpc_impl::CompletionQueue::AsyncNextInternal(void**, bool*, gpr_timespec) ()
#11 0x00000000004434f3 in grpc_impl::CompletionQueue::Next (
this=0x7ffebe0370c0, tag=0x7ffed89fd2d8, ok=0x7ffed89fd2d3)
at /local/include/grpcpp/impl/codegen/completion_queue_impl.h:179
#12 0x0000000000443152 in Sundial_Async_Client::contactRemoteDone (
---Type <return> to continue, or q <return> to quit---ret
this=0x7ffff5a08240, cq=0x7ffebe0370c0, txn=0x7ffebe00a380, node_id=1,
response=0x0, count=1) at grpc/grpc_async_client.cpp:70
#13 0x000000000043b2dc in TxnManager::process_2pc_phase2 (this=0x7ffebe00a380,
rc=ABORT, cq=0x7ffebe0370c0) at system/txn.cpp:462
#14 0x000000000043a38c in TxnManager::start (this=0x7ffebe00a380)
at system/txn.cpp:166
#15 0x000000000043f8c2 in WorkerThread::run (this=0x7fffdb133440)
at system/worker_thread.cpp:92
#16 0x0000000000441ff9 in start_thread (thread=0x7fffdb133440)
at system/main.cpp:204
#17 0x00007ffff64f36db in start_thread (arg=0x7ffed89ff700)
at pthread_create.c:463
#18 0x00007ffff621c88f in clone ()
at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
thread 81
#0 0x00007ffff64f99f3 in futex_wait_cancelable (private=<optimized out>,
expected=0, futex_word=0x7ffec49d4fb0)
at ../sysdeps/unix/sysv/linux/futex-internal.h:88
#1 __pthread_cond_wait_common (abstime=0x0, mutex=0x7ffff404c278,
cond=0x7ffec49d4f88) at pthread_cond_wait.c:502
#2 __pthread_cond_wait (cond=0x7ffec49d4f88, mutex=0x7ffff404c278)
at pthread_cond_wait.c:655
#3 0x000000000072f05a in gpr_cv_wait ()
#4 0x00000000006a12b0 in begin_worker ()
#5 0x00000000006a1757 in pollset_work ()
#6 0x000000000067dd5a in pollset_work(grpc_pollset*, grpc_pollset_worker**, long) ()
#7 0x00000000005219ea in grpc_pollset_work(grpc_pollset*, grpc_pollset_worker**, long) ()
#8 0x000000000054fa23 in cq_next(grpc_completion_queue*, gpr_timespec, void*)
()
#9 0x000000000054ff18 in grpc_completion_queue_next ()
#10 0x0000000000470676 in grpc_impl::CompletionQueue::AsyncNextInternal(void**, bool*, gpr_timespec) ()
#11 0x00000000004434f3 in grpc_impl::CompletionQueue::Next (
this=0x7ffebb632000, tag=0x7ffec49d52d8, ok=0x7ffec49d52d3)
at /local/include/grpcpp/impl/codegen/completion_queue_impl.h:179
#12 0x0000000000443152 in Sundial_Async_Client::contactRemoteDone (
---Type <return> to continue, or q <return> to quit---ret
this=0x7ffff5a08240, cq=0x7ffebb632000, txn=0x7ffebb608000, node_id=1,
response=0x0, count=1) at grpc/grpc_async_client.cpp:70
#13 0x000000000043b2dc in TxnManager::process_2pc_phase2 (this=0x7ffebb608000,
rc=ABORT, cq=0x7ffebb632000) at system/txn.cpp:462
#14 0x000000000043a38c in TxnManager::start (this=0x7ffebb608000)
at system/txn.cpp:166
#15 0x000000000043f8c2 in WorkerThread::run (this=0x7fffdb133e40)
at system/worker_thread.cpp:92
#16 0x0000000000441ff9 in start_thread (thread=0x7fffdb133e40)
at system/main.cpp:204
#17 0x00007ffff64f36db in start_thread (arg=0x7ffec49d7700)
at pthread_create.c:463
#18 0x00007ffff621c88f in clone ()
at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
thread 83
#0 0x00007ffff621cbb7 in epoll_wait (epfd=3, events=0x7ffff404c2b0,
maxevents=100, timeout=-1) at ../sysdeps/unix/sysv/linux/epoll_wait.c:30
#1 0x00000000006a0c7e in pollable_epoll(pollable*, long) ()
#2 0x00000000006a17c5 in pollset_work ()
#3 0x000000000067dd5a in pollset_work(grpc_pollset*, grpc_pollset_worker**, long) ()
#4 0x00000000005219ea in grpc_pollset_work(grpc_pollset*, grpc_pollset_worker**, long) ()
#5 0x000000000054fa23 in cq_next(grpc_completion_queue*, gpr_timespec, void*)
()
#6 0x000000000054ff18 in grpc_completion_queue_next ()
#7 0x0000000000470676 in grpc_impl::CompletionQueue::AsyncNextInternal(void**, bool*, gpr_timespec) ()
#8 0x00000000004434f3 in grpc_impl::CompletionQueue::Next (
this=0x7ffebbe000c0, tag=0x7ffec39d32d8, ok=0x7ffec39d32d3)
at /local/include/grpcpp/impl/codegen/completion_queue_impl.h:179
#9 0x0000000000443152 in Sundial_Async_Client::contactRemoteDone (
this=0x7ffff5a08240, cq=0x7ffebbe000c0, txn=0x7ffebbe037e0, node_id=1,
response=0x0, count=1) at grpc/grpc_async_client.cpp:70
#10 0x000000000043b2dc in TxnManager::process_2pc_phase2 (this=0x7ffebbe037e0,
rc=ABORT, cq=0x7ffebbe000c0) at system/txn.cpp:462
#11 0x000000000043a38c in TxnManager::start (this=0x7ffebbe037e0)
at system/txn.cpp:166
---Type <return> to continue, or q <return> to quit---ret
#12 0x000000000043f8c2 in WorkerThread::run (this=0x7fffdb133ec0)
at system/worker_thread.cpp:92
#13 0x0000000000441ff9 in start_thread (thread=0x7fffdb133ec0)
at system/main.cpp:204
#14 0x00007ffff64f36db in start_thread (arg=0x7ffec39d5700)
at pthread_create.c:463
#15 0x00007ffff621c88f in clone ()
at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
It seems like occassionally the asynchronous client will get stuck at cq->Next(&got_tag, &ok), and I ran this execution over 10,000 times so now I suspect the RPC was lost during the contact. Therefore the server never processes it and the rpc was never returned back. I'm thinking about if I need to find a way to have guaranteed delivery. The follows are my send request function and check response function. I'm wondering if I can get any helps of what to do at this stuck poin.
Status Sundial_Async_Client:: contactRemote(CompletionQueue* cq, TxnManager * txn,uint64_t node_id,SundialRequest& request, SundialResponse** response){
// Call object to store rpc data
AsyncClientCall* call = new AsyncClientCall;
// stub_->PrepareAsyncSayHello() creates an RPC object, returning
// an instance to store in "call" but does not actually start the RPC
// Because we are using the asynchronous API, we need to hold on to
// the "call" instance in order to get updates on the ongoing RPC.
call->response_reader =
stub_->PrepareAsynccontactRemote(&call->context, request, cq);
// StartCall initiates the RPC call
call->response_reader->StartCall();
call->reply=*response;
// Request that, upon completion of the RPC, "reply" be updated with the
// server's response; "status" with the indication of whether the operation
// was successful. Tag the request with the memory address of the call object.
call->response_reader->Finish(call->reply, &call->status, (void*)call);
return Status::OK;
}
Status Sundial_Async_Client::contactRemoteDone(CompletionQueue* cq, TxnManager * txn,uint64_t node_id, SundialResponse* response, int count){
void* got_tag;
bool ok = false;
int local_count=0;
// Block until the next result is available in the completion queue "cq".
while (cq->Next(&got_tag, &ok)) {
local_count++;
// The tag in this example is the memory location of the call object
AsyncClientCall* call = static_cast<AsyncClientCall*>(got_tag);
// Verify that the request was completed successfully. Note that "ok"
// corresponds solely to the request for updates introduced by Finish().
GPR_ASSERT(ok);
// Once we're complete, deallocate the call object.
//doing the cleaning
glob_stats->_stats[GET_THD_ID]->_resp_msg_count[ call->reply->response_type() ] ++;
glob_stats->_stats[GET_THD_ID]->_resp_msg_size[ call->reply->response_type() ] += call->reply->SpaceUsedLong();
delete call;
if(local_count==count){
break;
}
}
//txn->rpc_semaphore->decr();
return Status::OK;
}
I think this is more likely a logical issue. Are you sure you send out the request every time before you check the response?
I have just installed a fresh copy of WordPress on a Google GCP App Engine STANDARD environment following these steps: https://cloud.google.com/community/tutorials/run-wordpress-on-appengine-standard
The last step is pretty unclear or uncomplete. I have create the bucket (GCP Storage), installed the GCS official plugin (0.1.5) but when I upload some images on media folder i have this error:
Fatal error: Uncaught GuzzleHttp\Exception\ClientException: Client error: `GET https://www.googleapis.com/storage/v1/b/xxx-news.appspot.com/o/1%2F2019%2F11` resulted in a `404 Not Found` response: { "error": { "code": 404, "message": "No such object: xxx-news.appspot.com/1/2019/11", "errors": [ (truncated...) in /srv/wp-content/plugins/gcs/vendor/guzzlehttp/guzzle/src/Exception/RequestException.php:113 Stack trace: #0 /srv/wp-content/plugins/gcs/vendor/guzzlehttp/guzzle/src/Middleware.php(66): GuzzleHttp\Exception\RequestException::create(Object(GuzzleHttp\Psr7\Request), Object(GuzzleHttp\Psr7\Response)) #1 /srv/wp-content/plugins/gcs/vendor/guzzlehttp/promises/src/Promise.php(203): GuzzleHttp\Middleware::GuzzleHttp\{closure}(Object(GuzzleHttp\Psr7\Response)) #2 /srv/wp-content/plugins/gcs/vendor/guzzlehttp/promises/src/Promise.php(156): GuzzleHttp\Promise\Promise::callHandler(1, Object(GuzzleHttp\Psr7\Response), Array) #3 /srv/wp-content/plugins/gcs/vendor/guzzlehttp/promises/src/TaskQueue.php(47): GuzzleHttp\Promise\Promise::GuzzleHttp\Promise\{closure}() #4 /srv/wp-content/plugins/gcs/vendor/guzzlehttp/promises/src/Promise.php(246): GuzzleHttp\Promise\TaskQueue->run(true) #5 /srv/wp-content/plugins/gcs/vendor/guzzlehttp/promises/src/Promise.php(223): GuzzleHttp\Promise\Promise->invokeWaitFn() #6 /srv/wp-content/plugins/gcs/vendor/guzzlehttp/promises/src/Promise.php(267): GuzzleHttp\Promise\Promise->waitIfPending() #7 /srv/wp-content/plugins/gcs/vendor/guzzlehttp/promises/src/Promise.php(225): GuzzleHttp\Promise\Promise->invokeWaitList() #8 /srv/wp-content/plugins/gcs/vendor/guzzlehttp/promises/src/Promise.php(62): GuzzleHttp\Promise\Promise->waitIfPending() #9 /srv/wp-content/plugins/gcs/vendor/guzzlehttp/guzzle/src/Client.php(106): GuzzleHttp\Promise\Promise->wait() #10 /srv/wp-content/plugins/gcs/vendor/google/auth/src/HttpHandler/Guzzle6HttpHandler.php(34): GuzzleHttp\Client->send(Object(GuzzleHttp\Psr7\Request), Array) #11 [internal function]: Google\Auth\HttpHandler\Guzzle6HttpHandler->__invoke(Object(GuzzleHttp\Psr7\Request), Array) #12 /srv/wp-content/plugins/gcs/gcs.php(134): call_user_func_array(Object(Google\Auth\HttpHandler\Guzzle6HttpHandler), Array) #13 [internal function]: Google\Cloud\Storage\WordPress\{closure}(Object(GuzzleHttp\Psr7\Request), Array) #14 /srv/wp-content/plugins/gcs/vendor/google/cloud-core/src/ExponentialBackoff.php(74): call_user_func_array(Object(Closure), Array) #15 /srv/wp-content/plugins/gcs/vendor/google/cloud-core/src/RequestWrapper.php(166): Google\Cloud\Core\ExponentialBackoff->execute(Object(Closure), Array) #16 /srv/wp-content/plugins/gcs/vendor/google/cloud-core/src/RestTrait.php(95): Google\Cloud\Core\RequestWrapper->send(Object(GuzzleHttp\Psr7\Request), Array) #17 /srv/wp-content/plugins/gcs/vendor/google/cloud-storage/src/Connection/Rest.php(195): Google\Cloud\Storage\Connection\Rest->send('objects', 'get', Array) #18 /srv/wp-content/plugins/gcs/vendor/google/cloud-storage/src/StorageObject.php(1123): Google\Cloud\Storage\Connection\Rest->getObject(Array) #19 /srv/wp-content/plugins/gcs/vendor/google/cloud-storage/src/StorageObject.php(1074): Google\Cloud\Storage\StorageObject->reload(Array) #20 /srv/wp-content/plugins/gcs/vendor/google/cloud-storage/src/StreamWrapper.php(583): Google\Cloud\Storage\StorageObject->info() #21 /srv/wp-content/plugins/gcs/vendor/google/cloud-storage/src/StreamWrapper.php(488): Google\Cloud\Storage\StreamWrapper->urlStatFile() #22 [internal function]: Google\Cloud\Storage\StreamWrapper->url_stat('gs://xxx-news....', 2) #23 /srv/wp-includes/functions.php(1922): file_exists('gs://xxx-news....') #24 /srv/wp-includes/functions.php(2254): wp_mkdir_p('gs://xxx-news....') #25 /srv/wp-admin/includes/file.php(837): wp_upload_dir('2019-11-20 11:1...') #26 /srv/wp-admin/includes/file.php(953): _wp_handle_upload(Array, Array, '2019-11-20 11:1...', 'wp_handle_uploa...') #27 /srv/wp-admin/includes/media.php(301): wp_handle_upload(Array, Array, '2019-11-20 11:1...') #28 /srv/wp-admin/async-upload.php(93): media_handle_upload('async-upload', 0) #29 /srv/gae-app.php(53): require('/srv/wp-admin/a...') #30 {main} thrown in /srv/wp-content/plugins/gcs/vendor/guzzlehttp/guzzle/src/Exception/RequestException.php on line 113
I suppose i'm missing something on my ACL permission but i don't have idea how to proceed
Thanks!
GCS 0.1.5 present bugs on media loading
I have used instead 0.1.4
https://github.com/GoogleCloudPlatform/wordpress-plugins/issues/68
I am trying to use QML with cygwin.
I prepared this very simple code, simple.qml.
import QtQuick 2.0
Rectangle { }
Then, qmlscene-qt5 simple.qml causes segmentation fault. How can I avoid segfaluts?
Software versions are shown below:
Windows: both 8.1 64bit and 10 64bit cause segfault
cygwin: 2.5.0-1 x86
xorg-server: 1.18.2-1
LibQt5Core5, qt5-declarative-tools and etc.: 5.5.1-1
Incidentally, this code does not cause segfault.
import QtQuick 2.0
import QtQuick.Window 2.0
import QtQuick.Controls 1.0
Window{
title: 'window'
Label{
// text: 'hello, world!'
// If I uncomment the above line, a segfault emerges.
}
}
Thank you for reading this question.
FYI, a gdb log is shown below. I execute gdb /usr/bin/qmlscene-qt5 and examine where after segfaulted.
#0 0xfd6411db in ?? ()
#1 0x444f41b6 in gallium_dri!__driDriverGetExtensions_swrast ()
from C:/cygwin/lib/dri/swrast_dri.so
#2 0x444f465a in gallium_dri!__driDriverGetExtensions_swrast ()
from C:/cygwin/lib/dri/swrast_dri.so
#3 0x4441426d in gallium_dri!__driDriverGetExtensions_swrast ()
from C:/cygwin/lib/dri/swrast_dri.so
#4 0x44414ac0 in gallium_dri!__driDriverGetExtensions_swrast ()
from C:/cygwin/lib/dri/swrast_dri.so
#5 0x4440bd7d in gallium_dri!__driDriverGetExtensions_swrast ()
from C:/cygwin/lib/dri/swrast_dri.so
#6 0x4440c247 in gallium_dri!__driDriverGetExtensions_swrast ()
from C:/cygwin/lib/dri/swrast_dri.so
#7 0x44527ca5 in gallium_dri!__driDriverGetExtensions_swrast ()
from C:/cygwin/lib/dri/swrast_dri.so
#8 0x442578c6 in gallium_dri!__driDriverGetExtensions_swrast ()
from C:/cygwin/lib/dri/swrast_dri.so
#9 0x44228415 in gallium_dri!__driDriverGetExtensions_swrast ()
from C:/cygwin/lib/dri/swrast_dri.so
#10 0x44228941 in gallium_dri!__driDriverGetExtensions_swrast ()
from C:/cygwin/lib/dri/swrast_dri.so
#11 0x6727f40f in QOpenGLFunctions::glDrawElements (indices=<optimized out>,
type=5123, count=<optimized out>, mode=<optimized out>,
this=<optimized out>) at /usr/include/qt5/QtGui/qopenglfunctions.h:727
#12 QSGBatchRenderer::Renderer::renderMergedBatch (this=this#entry=0x8041e638,
batch=<optimized out>)
at /usr/src/debug/qt5-declarative-5.5.1-1/src/quick/scenegraph/coreapi/qsgbatchrenderer.cpp:2299
#13 0x672811a7 in QSGBatchRenderer::Renderer::renderMergedBatch (
batch=<optimized out>, this=0x8041e638)
at /usr/src/debug/qt5-declarative-5.5.1-1/src/quick/scenegraph/coreapi/qsgbatchrenderer.cpp:2512
#14 QSGBatchRenderer::Renderer::renderBatches (this=this#entry=0x8041e638)
at /usr/src/debug/qt5-declarative-5.5.1-1/src/quick/scenegraph/coreapi/qsgbatchrenderer.cpp:2493
#15 0x67286f3f in QSGBatchRenderer::Renderer::render (this=0x8041e638)
at /usr/src/debug/qt5-declarative-5.5.1-1/src/quick/scenegraph/coreapi/qsgbatchrenderer.cpp:2681
#16 0x6728fc33 in QSGRenderer::renderScene (this=this#entry=0x8041e638,
bindable=...)
at /usr/src/debug/qt5-declarative-5.5.1-1/src/quick/scenegraph/coreapi/qsgrenderer.cpp:208
#17 0x67290657 in QSGRenderer::renderScene (this=0x8041e638, fboId=0)
at /usr/src/debug/qt5-declarative-5.5.1-1/src/quick/scenegraph/coreapi/qsgrenderer.cpp:168
#18 0x6729fc84 in QSGRenderContext::renderNextFrame (this=0x802763f0,
renderer=0x8041e638, fboId=0)
at /usr/src/debug/qt5-declarative-5.5.1-1/src/quick/scenegraph/qsgcontext.cpp:558
#19 0x672e6d30 in QQuickWindowPrivate::renderSceneGraph (
this=this#entry=0x80275ff0, size=...)
at /usr/src/debug/qt5-declarative-5.5.1-1/src/quick/items/qquickwindow.cpp:383
#20 0x672b80a5 in QSGGuiThreadRenderLoop::renderWindow (
this=this#entry=0x8027e1e8, window=0x80275fd8)
at /usr/src/debug/qt5-declarative-5.5.1-1/src/quick/scenegraph/qsgrenderloop.cpp:378
#21 0x672b9c9f in QSGGuiThreadRenderLoop::exposureChanged (this=0x8027e1e8,
window=0x80275fd8)
at /usr/src/debug/qt5-declarative-5.5.1-1/src/quick/scenegraph/qsgrenderloop.cpp:422
#22 0x67cba4f9 in QWindow::event (this=0x80275fd8, ev=0x28c834)
at /usr/src/debug/qt5-base-5.5.1-1/src/gui/kernel/qwindow.cpp:2053
#23 0x672f40ce in QQuickWindow::event (this=0x80275fd8, e=0x28c834)
at /usr/src/debug/qt5-declarative-5.5.1-1/src/quick/items/qquickwindow.cpp:1413
#24 0x6471b4a1 in QApplicationPrivate::notify_helper (
this=this#entry=0x80060500, receiver=receiver#entry=0x80275fd8,
e=e#entry=0x28c834)
at /usr/src/debug/qt5-base-5.5.1-1/src/widgets/kernel/qapplication.cpp:3716
#25 0x647207dc in QApplication::notify (this=0x28cba4, receiver=0x80275fd8,
e=0x28c834)
at /usr/src/debug/qt5-base-5.5.1-1/src/widgets/kernel/qapplication.cpp:3499
#26 0x68d90d62 in QCoreApplication::notifyInternal (this=0x28cba4,
receiver=0x80275fd8, event=0x28c834)
at /usr/src/debug/qt5-base-5.5.1-1/src/corelib/kernel/qcoreapplication.cpp:965
#27 0x67cb3377 in QCoreApplication::sendSpontaneousEvent (event=0x28c834,
receiver=0x80275fd8)
at /usr/src/debug/qt5-base-5.5.1-1/include/QtCore/../../src/corelib/kernel/qcoreapplication.h:227
#28 QGuiApplicationPrivate::processExposeEvent (e=e#entry=0x802fdef0)
at /usr/src/debug/qt5-base-5.5.1-1/src/gui/kernel/qguiapplication.cpp:2648
#29 0x67cb41b8 in QGuiApplicationPrivate::processWindowSystemEvent (
e=e#entry=0x802fdef0)
at /usr/src/debug/qt5-base-5.5.1-1/src/gui/kernel/qguiapplication.cpp:1643
#30 0x67c9b020 in QWindowSystemInterface::sendWindowSystemEvents (flags=...)
at /usr/src/debug/qt5-base-5.5.1-1/src/gui/kernel/qwindowsysteminterface.cpp:625
#31 0x64654546 in userEventSourceDispatch (source=0x800a4ea0)
at /usr/src/debug/qt5-base-5.5.1-1/src/platformsupport/eventdispatchers/qeventdispatcher_glib.cpp:70
#32 0x55ff0173 in g_main_context_dispatch () from /usr/bin/cygglib-2.0-0.dll
#33 0x55ff03da in g_main_context_dispatch () from /usr/bin/cygglib-2.0-0.dll
#34 0x55ff047a in g_main_context_iteration () from /usr/bin/cygglib-2.0-0.dll
#35 0x68dd3b12 in QEventDispatcherGlib::processEvents (this=0x80060710,
flags=...)
at /usr/src/debug/qt5-base-5.5.1-1/src/corelib/kernel/qeventdispatcher_glib.cpp:418
#36 0x68d8fd3f in QEventLoop::processEvents (flags=..., this=0x28caac)
at /usr/src/debug/qt5-base-5.5.1-1/src/corelib/kernel/qeventloop.cpp:128
#37 QEventLoop::exec (this=this#entry=0x28caac, flags=flags#entry=...)
at /usr/src/debug/qt5-base-5.5.1-1/src/corelib/kernel/qeventloop.cpp:204
#38 0x68d96a43 in QCoreApplication::exec ()
at /usr/src/debug/qt5-base-5.5.1-1/src/corelib/kernel/qcoreapplication.cpp:1229
#39 0x00404157 in main (argc=2, argv=0x28cc5c)
at /usr/src/debug/qt5-declarative-5.5.1-1/tools/qmlscene/main.cpp:598
Try reverting dri-drivers to version 11.0.9-1
There is a similar issue on 32bit.
https://cygwin.com/ml/cygwin/2016-04/msg00254.html