Skip to content
This repository has been archived by the owner on Oct 12, 2023. It is now read-only.

Log info about the exiting out of process module. Fix for item 2 in #339 #371

Merged
merged 6 commits into from
Aug 24, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
cmake_minimum_required(VERSION 2.8.12)
project(azure_iot_gateway_sdk)

set(GATEWAY_VERSION 1.0.5 CACHE INTERNAL "")
set(GATEWAY_VERSION 1.0.6 CACHE INTERNAL "")
set(COMPANY_NAME "Microsoft")
SET(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)

Expand Down Expand Up @@ -84,6 +84,11 @@ option(use_http "set use_http to ON if http is to be used, set to OFF to not use
option(use_mqtt "set use_mqtt to ON if mqtt is to be used, set to OFF to not use mqtt" ON)
option(use_xplat_uuid "use the SDK's platform-independent UUID implementation (default is OFF)" OFF)

if(WIN32)
# C-SDK requires this to be set for some functions we use.
set(use_etw OFF)
endif()

option(enable_event_system "Build event system (default is ON)" ON)

set_property(GLOBAL PROPERTY USE_FOLDERS ON)
Expand Down
2 changes: 2 additions & 0 deletions bindings/java/tests/real_string.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
#define STRING_empty real_STRING_empty
#define STRING_length real_STRING_length
#define STRING_compare real_STRING_compare
#define STRING_replace real_STRING_replace


#define GBALLOC_H

Expand Down
2 changes: 2 additions & 0 deletions core/tests/dotnet_core_loader_ut/real_strings.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
#define STRING_empty real_STRING_empty
#define STRING_length real_STRING_length
#define STRING_compare real_STRING_compare
#define STRING_replace real_STRING_replace


#undef STRINGS_H
Expand All @@ -47,6 +48,7 @@
#undef STRING_empty
#undef STRING_length
#undef STRING_compare
#undef STRING_replace

#endif

Expand Down
2 changes: 2 additions & 0 deletions core/tests/dotnet_loader_ut/real_strings.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
#define STRING_empty real_STRING_empty
#define STRING_length real_STRING_length
#define STRING_compare real_STRING_compare
#define STRING_replace real_STRING_replace


#undef STRINGS_H
Expand All @@ -47,6 +48,7 @@
#undef STRING_empty
#undef STRING_length
#undef STRING_compare
#undef STRING_replace

#endif

Expand Down
2 changes: 2 additions & 0 deletions core/tests/dynamic_loader_ut/real_strings.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
#define STRING_empty real_STRING_empty
#define STRING_length real_STRING_length
#define STRING_compare real_STRING_compare
#define STRING_replace real_STRING_replace


#undef STRINGS_H
Expand All @@ -47,6 +48,7 @@
#undef STRING_empty
#undef STRING_length
#undef STRING_compare
#undef STRING_replace

#endif

Expand Down
2 changes: 2 additions & 0 deletions core/tests/java_loader_ut/real_strings.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
#define STRING_empty real_STRING_empty
#define STRING_length real_STRING_length
#define STRING_compare real_STRING_compare
#define STRING_replace real_STRING_replace


#undef STRINGS_H
Expand All @@ -47,6 +48,7 @@
#undef STRING_empty
#undef STRING_length
#undef STRING_compare
#undef STRING_replace

#endif

Expand Down
1 change: 1 addition & 0 deletions core/tests/module_loader_ut/real_strings.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
#define STRING_empty real_STRING_empty
#define STRING_length real_STRING_length
#define STRING_compare real_STRING_compare
#define STRING_replace real_STRING_replace

#define GBALLOC_H

Expand Down
2 changes: 2 additions & 0 deletions core/tests/node_loader_ut/real_strings.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
#define STRING_empty real_STRING_empty
#define STRING_length real_STRING_length
#define STRING_compare real_STRING_compare
#define STRING_replace real_STRING_replace


#undef STRINGS_H
Expand All @@ -47,6 +48,7 @@
#undef STRING_empty
#undef STRING_length
#undef STRING_compare
#undef STRING_replace

#endif

Expand Down
2 changes: 2 additions & 0 deletions core/tests/outprocess_loader_ut/outprocess_loader_ut.c
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,8 @@ MOCK_FUNCTION_WITH_CODE(, int, uv_process_kill, uv_process_t *, handle, int, sig
MOCK_FUNCTION_END(0);
MOCK_FUNCTION_WITH_CODE(, int, uv_spawn, uv_loop_t *, loop, uv_process_t *, handle, const uv_process_options_t *, options)
MOCK_FUNCTION_END(0);
MOCK_FUNCTION_WITH_CODE(, void, uv_close, uv_handle_t *, handle, uv_close_cb, close_cb);
MOCK_FUNCTION_END();

// ** Mocking uv.h (Event loop)
MOCK_FUNCTION_WITH_CODE(, uv_loop_t *, uv_default_loop);
Expand Down
2 changes: 2 additions & 0 deletions core/tests/outprocess_loader_ut/real_strings.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
#define STRING_empty real_STRING_empty
#define STRING_length real_STRING_length
#define STRING_compare real_STRING_compare
#define STRING_replace real_STRING_replace


#undef STRINGS_H
Expand All @@ -47,6 +48,7 @@
#undef STRING_empty
#undef STRING_length
#undef STRING_compare
#undef STRING_replace

#endif

Expand Down
2 changes: 2 additions & 0 deletions core/tests/outprocess_module_ut/real_strings.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
#define STRING_empty real_STRING_empty
#define STRING_length real_STRING_length
#define STRING_compare real_STRING_compare
#define STRING_replace real_STRING_replace


#undef STRINGS_H
Expand All @@ -47,6 +48,7 @@
#undef STRING_empty
#undef STRING_length
#undef STRING_compare
#undef STRING_replace

#endif

Expand Down
2 changes: 1 addition & 1 deletion deps/c-utility
Submodule c-utility updated 70 files
+2 −0 .gitignore
+88 −31 CMakeLists.txt
+1 −0 adapters/dns_async.c
+24 −2 adapters/platform_linux.c
+16 −10 adapters/platform_win32.c
+1 −1 adapters/sntp_lwip.c
+0 −5 adapters/sslClient_arduino.cpp
+205 −93 adapters/tlsio_mbedtls.c
+8 −0 build_all/esp32/proj/Makefile
+17 −0 build_all/esp32/proj/main/Kconfig.projbuild
+97 −0 build_all/esp32/proj/main/azure_main.c
+5 −0 build_all/esp32/proj/main/component.mk
+101 −0 build_all/esp32/sdk/component.mk
+1 −1 build_all/packaging/linux/debian/changelog-trusty
+1 −1 build_all/packaging/linux/debian/changelog-vivid
+1 −1 build_all/packaging/linux/debian/changelog-xenial
+1 −1 build_all/packaging/windows/Microsoft.Azure.C.SharedUtility.nuspec
+8 −8 build_all/packaging/windows/Microsoft.Azure.C.SharedUtility.targets
+20 −6 configs/azure_c_shared_utilityFunctions.cmake
+13 −0 devdoc/buffer_requirements.md
+36 −2 devdoc/singlylinkedlist_requirements.md
+25 −3 devdoc/strings_requirements.md
+1 −0 devdoc/uws_client_requirements.md
+2 −0 devdoc/x509_schannel.md
+1 −0 inc/azure_c_shared_utility/buffer_.h
+37 −35 inc/azure_c_shared_utility/crt_abstractions.h
+591 −0 inc/azure_c_shared_utility/etwlogger.h
+23 −0 inc/azure_c_shared_utility/etwlogger_driver.h
+16 −0 inc/azure_c_shared_utility/lwip/sntp_os.h
+5 −0 inc/azure_c_shared_utility/lwip/socket_async_os.h
+16 −0 inc/azure_c_shared_utility/lwip_esp32/sntp_os.h
+17 −0 inc/azure_c_shared_utility/lwip_esp32/socket_async_os.h
+2 −0 inc/azure_c_shared_utility/shared_util_options.h
+24 −0 inc/azure_c_shared_utility/singlylinkedlist.h
+1 −0 inc/azure_c_shared_utility/strings.h
+2 −0 inc/azure_c_shared_utility/tls_config.h
+5 −0 inc/azure_c_shared_utility/tlsio_mbedtls.h
+3 −0 src/aziotsharedutil.def
+23 −0 src/buffer.c
+1 −1 src/connection_string_parser.c
+11 −0 src/etw_provider_generate.cmd
+77 −0 src/etwlogger.man
+264 −0 src/etwlogger_driver.c
+108 −0 src/etwxlogging.c
+108 −1 src/singlylinkedlist.c
+37 −4 src/strings.c
+274 −188 src/tlsio_openssl.c
+51 −33 src/tlsio_schannel.c
+4 −4 src/tlsio_wolfssl.c
+15 −3 src/uws_client.c
+67 −71 src/x509_openssl.c
+338 −164 src/x509_schannel.c
+1 −1 tests/base64_ut/CMakeLists.txt
+62 −6 tests/base64_ut/base64_ut.c
+135 −70 tests/buffer_ut/buffer_ut.c
+49 −47 tests/connectionstringparser_ut/connectionstringparser_ut.c
+1 −0 tests/real_test_files/real_buffer.c
+12 −0 tests/real_test_files/real_constbuffer.c
+17 −0 tests/real_test_files/real_singlylinkedlist.c
+20 −2 tests/real_test_files/real_strings.h
+374 −0 tests/singlylinkedlist_ut/singlylinkedlist_ut.c
+198 −71 tests/strings_ut/strings_ut.c
+74 −2 tests/uws_client_ut/uws_client_ut.c
+43 −97 tests/x509_openssl_ut/x509_openssl_ut.c
+372 −329 tests/x509_schannel_ut/x509_schannel_ut.c
+1 −1 testtools/ctest
+1 −1 testtools/testrunner
+1 −1 testtools/umock-c
+10 −0 thirdpartynotice.txt
+1 −1 tools/mbed_build_scripts/release_mbed_project.cmd
2 changes: 1 addition & 1 deletion deps/ctest
Submodule ctest updated from a9ed5a to f75c43
2 changes: 1 addition & 1 deletion deps/iot-sdk-c
Submodule iot-sdk-c updated 149 files
2 changes: 1 addition & 1 deletion deps/testrunner
2 changes: 1 addition & 1 deletion deps/uamqp
Submodule uamqp updated 50 files
+5 −3 CMakeLists.txt
+1 −1 build_all/packaging/linux/debian/changelog-trusty
+1 −1 build_all/packaging/linux/debian/changelog-vivid
+1 −1 build_all/packaging/linux/debian/changelog-xenial
+2 −2 build_all/packaging/windows/Microsoft.Azure.uamqp.nuspec
+1 −1 deps/azure-c-shared-utility
+1 −1 deps/azure-c-testrunnerswitcher
+1 −1 deps/azure-ctest
+1 −1 deps/umock-c
+97 −97 devdoc/cbs_requirements.md
+2 −2 devdoc/sasl_mechanism_requirements.md
+111 −0 devdoc/sasl_server_mechanism_requirements.md
+212 −103 devdoc/saslclientio_requirements.md
+0 −1 inc/azure_uamqp_c/amqp_definitions.h
+1 −1 inc/azure_uamqp_c/amqp_frame_codec.h
+0 −1 inc/azure_uamqp_c/amqpvalue.h
+0 −1 inc/azure_uamqp_c/cbs.h
+1 −1 inc/azure_uamqp_c/connection.h
+0 −1 inc/azure_uamqp_c/frame_codec.h
+0 −1 inc/azure_uamqp_c/message_receiver.h
+1 −1 inc/azure_uamqp_c/sasl_frame_codec.h
+1 −1 inc/azure_uamqp_c/sasl_server_mechanism.h
+0 −8 inc/azure_uamqp_c/saslclientio.h
+31 −9 readme.md
+1 −1 src/amqp_frame_codec.c
+15 −22 src/amqpvalue_to_string.c
+1 −1 src/connection.c
+1 −1 src/header_detect_io.c
+6 −2 src/link.c
+21 −6 src/message_sender.c
+1 −1 src/sasl_frame_codec.c
+1 −1 src/sasl_mechanism.c
+166 −0 src/sasl_server_mechanism.c
+174 −101 src/saslclientio.c
+1 −1 src/session.c
+1 −0 tests/CMakeLists.txt
+61 −82 tests/amqp_frame_codec_ut/amqp_frame_codec_ut.c
+0 −1 tests/amqp_management_ut/amqp_management_ut.c
+0 −1 tests/cbs_ut/cbs_ut.c
+98 −119 tests/connection_ut/connection_ut.c
+115 −116 tests/frame_codec_ut/frame_codec_ut.c
+1 −1 tests/header_detect_io_ut/header_detect_io_ut.c
+80 −73 tests/local_client_server_tcp_perf/local_client_server_tcp_perf.c
+43 −60 tests/sasl_frame_codec_ut/sasl_frame_codec_ut.c
+4 −4 tests/sasl_mechanism_ut/sasl_mechanism_ut.c
+18 −0 tests/sasl_server_mechanism_ut/CMakeLists.txt
+11 −0 tests/sasl_server_mechanism_ut/main.c
+573 −0 tests/sasl_server_mechanism_ut/sasl_server_mechanism_ut.c
+2,071 −1,227 tests/saslclientio_ut/saslclientio_ut.c
+25 −25 tests/session_ut/session_ut.c
2 changes: 1 addition & 1 deletion deps/umock-c
2 changes: 1 addition & 1 deletion proxy/gateway/nodejs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,4 @@
},
"author": "Microsoft",
"license": "MIT"
}
}
9 changes: 7 additions & 2 deletions proxy/outprocess/src/module_loaders/outprocess_loader.c
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,18 @@ static VECTOR_HANDLE uv_processes = NULL;
static THREAD_HANDLE uv_thread = NULL;
static tickcounter_ms_t uv_process_grace_period_ms = 0;

void exit_cb(uv_process_t* p, int64_t exit_status, int term_signal)
{
LogInfo("Out process: %d, exited with status: "INT64_PRINTF", signal: %d !!\n", p->pid, exit_status, term_signal);
uv_close((uv_handle_t *) p, NULL);
}

int launch_child_process_from_entrypoint (OUTPROCESS_LOADER_ENTRYPOINT * outprocess_entry)
{
int result;

uv_process_t * child = NULL;
const uv_process_options_t options = {
.exit_cb = NULL,
.exit_cb = exit_cb,
.file = outprocess_entry->process_argv[0],
.args = outprocess_entry->process_argv,
.flags = UV_PROCESS_WINDOWS_VERBATIM_ARGUMENTS
Expand Down
9 changes: 8 additions & 1 deletion samples/proxy_sample/src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,14 @@ int main(int argc, char** argv)
{
printf("gateway successfully created from JSON\n");
printf("gateway shall run until ENTER is pressed\n");
(void)getchar();
// Since the std descriptors are shared between the out processes in launch case
// EOF is generated when the child process dies. Make sure the getchar
// can survive this.
int c;
while((c = getchar()) == EOF)
{
printf("\nGot %d from getchar. Continuing to wait for ENTER\n", c);
}
Gateway_Destroy(gateway);
}
}
Expand Down
2 changes: 1 addition & 1 deletion tools/docs/c/Doxyfile
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ PROJECT_NAME = "Microsoft Azure IoT Gateway SDK"
# could be handy for archiving the generated documentation or if some version
# control system is used.

PROJECT_NUMBER = 1.0.5
PROJECT_NUMBER = 1.0.6

# Using the PROJECT_BRIEF tag one can provide an optional one line description
# for a project that appears at the top of each page and should give viewer a
Expand Down
10 changes: 10 additions & 0 deletions tools/release/bump_version/inputs.js
Original file line number Diff line number Diff line change
Expand Up @@ -189,4 +189,14 @@ module.exports = [
"nsmap": {"mavenns": "http://maven.apache.org/POM/4.0.0"},
"replaceString": "bindings.java",
},

///////////////////////////////////////////////////
// Node.js remote module
///////////////////////////////////////////////////
{
"taskType": "jsonReplaceTask",
"filePath": "proxy/gateway/nodejs/package.json",
"search": "version",
"replaceString": "proxygateway.nodejs",
}
];
5 changes: 3 additions & 2 deletions tools/release/bump_version/versions.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"gateway":
{
"core" : "1.0.5"
"core" : "1.0.6"
},
"bindings" :
{
Expand All @@ -11,6 +11,7 @@
},
"proxygateway" :
{
"java" : "1.0.1"
"java" : "1.0.1",
"nodejs" : "0.0.1"
}
}