You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@nifi.apache.org by "fgerlits (via GitHub)" <gi...@apache.org> on 2024/09/05 07:12:02 UTC
[PR] MINIFICPP-2451 Upgrade aws-sdk-cpp from 1.11.219 to 1.11.396 [nifi-minifi-cpp]
fgerlits opened a new pull request, #1862:
URL: https://github.com/apache/nifi-minifi-cpp/pull/1862
Upgrade to pick up the fix of https://github.com/aws/aws-sdk-cpp/issues/1858, which was breaking our Windows CI build.
https://issues.apache.org/jira/browse/MINIFICPP-2451
---
Thank you for submitting a contribution to Apache NiFi - MiNiFi C++.
In order to streamline the review of the contribution we ask you
to ensure the following steps have been taken:
### For all changes:
- [x] Is there a JIRA ticket associated with this PR? Is it referenced in the commit message?
- [x] Does your PR title start with MINIFICPP-XXXX where XXXX is the JIRA number you are trying to resolve? Pay particular attention to the hyphen "-" character.
- [x] Has your PR been rebased against the latest commit within the target branch (typically main)?
- [x] Is your initial contribution a single, squashed commit?
### For code changes:
- [ ] If adding new dependencies to the code, are these dependencies licensed in a way that is compatible for inclusion under [ASF 2.0](http://www.apache.org/legal/resolved.html#category-a)?
- [ ] If applicable, have you updated the LICENSE file?
- [ ] If applicable, have you updated the NOTICE file?
### For documentation related changes:
- [ ] Have you ensured that format looks appropriate for the output in which it is rendered?
### Note:
Please ensure that once the PR is submitted, you check GitHub Actions CI results for build issues and submit an update to your PR as soon as possible.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@nifi.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] MINIFICPP-2451 Upgrade aws-sdk-cpp from 1.11.219 to 1.11.396 [nifi-minifi-cpp]
Posted by "szaszm (via GitHub)" <gi...@apache.org>.
szaszm commented on code in PR #1862:
URL: https://github.com/apache/nifi-minifi-cpp/pull/1862#discussion_r1745813737
##########
extensions/aws/utils/AWSSdkLogger.cpp:
##########
@@ -60,11 +62,36 @@ Aws::Utils::Logging::LogLevel AWSSdkLogger::GetLogLevel() const {
}
void AWSSdkLogger::Log(Aws::Utils::Logging::LogLevel log_level, const char* tag, const char* format_str, ...) { // NOLINT(cert-dcl50-cpp)
- logger_->log_with_level(mapFromAwsLevels(log_level), "[{}] {}", tag, format_str);
+ va_list args;
+ va_start(args, format_str);
+ vaLog(log_level, tag, format_str, args);
+ va_end(args);
+}
+
+void AWSSdkLogger::vaLog(Aws::Utils::Logging::LogLevel log_level, const char* tag, const char* format_str, va_list args) {
+ va_list args_copy;
+ va_copy(args_copy, args);
+ const int buffer_size = std::vsnprintf(nullptr, 0, format_str, args_copy) + 1; // +1 for the terminating \0 character
+ va_end(args_copy);
+
+ std::vector<char> buffer(buffer_size);
+
+ const int length = std::vsnprintf(buffer.data(), buffer_size, format_str, args);
+ if (length < 0) {
+ logger_->log_error("A log line from aws-sdk-cpp could not be processed: [{}] {}", tag, format_str);
+ return;
+ }
+ gsl_Expects(length <= buffer_size);
Review Comment:
`gsl_Expects` is meant to check for preconditions. Use `gsl_Assert` for things that are not pre- or postconditions. The effect is the same.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@nifi.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] MINIFICPP-2451 Upgrade aws-sdk-cpp from 1.11.219 to 1.11.396 [nifi-minifi-cpp]
Posted by "fgerlits (via GitHub)" <gi...@apache.org>.
fgerlits commented on code in PR #1862:
URL: https://github.com/apache/nifi-minifi-cpp/pull/1862#discussion_r1746614775
##########
extensions/aws/utils/AWSSdkLogger.cpp:
##########
@@ -60,11 +62,36 @@ Aws::Utils::Logging::LogLevel AWSSdkLogger::GetLogLevel() const {
}
void AWSSdkLogger::Log(Aws::Utils::Logging::LogLevel log_level, const char* tag, const char* format_str, ...) { // NOLINT(cert-dcl50-cpp)
- logger_->log_with_level(mapFromAwsLevels(log_level), "[{}] {}", tag, format_str);
+ va_list args;
+ va_start(args, format_str);
+ vaLog(log_level, tag, format_str, args);
+ va_end(args);
+}
+
+void AWSSdkLogger::vaLog(Aws::Utils::Logging::LogLevel log_level, const char* tag, const char* format_str, va_list args) {
+ va_list args_copy;
+ va_copy(args_copy, args);
+ const int buffer_size = std::vsnprintf(nullptr, 0, format_str, args_copy) + 1; // +1 for the terminating \0 character
+ va_end(args_copy);
+
+ std::vector<char> buffer(buffer_size);
+
+ const int length = std::vsnprintf(buffer.data(), buffer_size, format_str, args);
+ if (length < 0) {
+ logger_->log_error("A log line from aws-sdk-cpp could not be processed: [{}] {}", tag, format_str);
+ return;
+ }
+ gsl_Expects(length <= buffer_size);
Review Comment:
fixed in 7e46fce84405668f8fdfa5e323bae8f71fbab858
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@nifi.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] MINIFICPP-2451 Upgrade aws-sdk-cpp from 1.11.219 to 1.11.396 [nifi-minifi-cpp]
Posted by "martinzink (via GitHub)" <gi...@apache.org>.
martinzink closed pull request #1862: MINIFICPP-2451 Upgrade aws-sdk-cpp from 1.11.219 to 1.11.396
URL: https://github.com/apache/nifi-minifi-cpp/pull/1862
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@nifi.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org