Azure / azure-storage-cpp

Microsoft Azure Storage Client Library for C++
http://azure.github.io/azure-storage-cpp
Apache License 2.0
131 stars 147 forks source link

azure_storage_cpp hangs with asynchronous calls in apache #421

Open dczaretsky opened 11 months ago

dczaretsky commented 11 months ago

I'm integrating the azure-storage-cpp library in some custom c/c++ code for some high-performance web applications, which is using Azure Table Storage to read/write data. The c++ code is being compiled into a .so library, which is then being called by a PHP application running via apache on an Ubuntu webserver. I'm using SWIG to generate the interface between the C++ code and PHP.

In earlier versions I've had no issues with this code. But since updating to the latest version I'm finding that the application hangs indefinitely when calling the asynchronous function (e.g. table.exists(), table.create_if_not_exists(), etc). The strange thing is that this only occurs when calling the php file through a web browser (or curl request). However, calling from the apache command line works without any issues. I've compared the php.ini files and have found no differences in the configurations for CLI and Apache. I've also tried adding logging, but nothing is reported.

I'm wondering if there is a bug that might block asynchronous requests via Apache. The ubuntu server is not running selinux and I can't seem to find any reason why such a request might be blocked.

I've attached a test project that will create the C++ and PHP application. To run: sudo ./build_azure_test.sh

In test.php, make sure to set your Azure storage account and key.

To test via PHP CLI: sudo -u www-data php -f test.php To test vai web-browser, visit: http://mywebsite.com/test.php

If table is successfully created, you should see the output: azure test result = succeeded

azure_test.tar.gz

Jinming-Hu commented 11 months ago

Hi @dczaretsky , this SDK was deprecated 2 years ago, Please do not use it in new products.

dczaretsky commented 11 months ago

@Jinming-Hu, I didn't see any replacement for Azure Storage Tables in the new c++ SDK. What are the options?

Jinming-Hu commented 11 months ago

@dczaretsky we don't have Tables support in new C++ SDK.

Since you're calling into C++ from php, I guess language bindings is needed anyway. You can check other languages that have table SDK support.

dczaretsky commented 11 months ago

Unfortunately, re-writing the entire application into another language is not an option.

Have you been able to run the attached test on Ubuntu?

I was investigating further, and seems there could be some possible issues with SSL connections, but nothing has resolved the issue.

Jinming-Hu commented 11 months ago

@dczaretsky sure, you can still use the SDK if it works for you. But you should be aware that we do not provide support for deprecated packages.