Skip to content

Commit

Permalink
Merge branch 'develop' into docs/idempotency-guarantees
Browse files Browse the repository at this point in the history
* develop:
  chore(deps-dev): bump pytest from 8.2.2 to 8.3.1 (aws-powertools#4799)
  chore(deps): bump docker/setup-qemu-action from 3.1.0 to 3.2.0 (aws-powertools#4800)
  chore(deps): bump docker/setup-buildx-action from 3.4.0 to 3.5.0 (aws-powertools#4801)
  chore(deps-dev): bump ruff from 0.5.3 to 0.5.4 (aws-powertools#4798)
  chore(logger): use package logger over source logger to reduce noise (aws-powertools#4793)
  chore(ci): changelog rebuild (aws-powertools#4794)
  chore(ci): new pre-release 2.41.1a7 (aws-powertools#4792)
  chore(deps-dev): bump cfn-lint from 1.8.1 to 1.8.2 (aws-powertools#4788)
  chore(deps-dev): bump mypy-boto3-secretsmanager from 1.34.128 to 1.34.145 in the boto-typing group (aws-powertools#4787)
  chore(deps): bump aws-actions/closed-issue-message from 8b6324312193476beecf11f8e8539d73a3553bf4 to 80edfc24bdf1283400eb04d20a8a605ae8bf7d48 (aws-powertools#4786)
  chore(ci): changelog rebuild (aws-powertools#4784)
  fix(idempotency): ensure in_progress_expiration field is set on Lambda timeout. (aws-powertools#4773)
  • Loading branch information
heitorlessa committed Jul 23, 2024
2 parents 66db87a + c77869a commit 82ea438
Show file tree
Hide file tree
Showing 9 changed files with 70 additions and 54 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/on_closed_issues.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
permissions:
issues: write # comment on issues
steps:
- uses: aws-actions/closed-issue-message@8b6324312193476beecf11f8e8539d73a3553bf4
- uses: aws-actions/closed-issue-message@80edfc24bdf1283400eb04d20a8a605ae8bf7d48
with:
repo-token: "${{ secrets.GITHUB_TOKEN }}"
message: |
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/publish_v2_layer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -117,14 +117,14 @@ jobs:
pip install --require-hashes -r requirements.txt
- name: Set up QEMU
uses: docker/setup-qemu-action@5927c834f5b4fdf503fca6f4c7eccda82949e1ee # v2.0.0
uses: docker/setup-qemu-action@49b3bc8e6bdd4a60e6116a5414239cba5943d3cf # v2.0.0
with:
platforms: arm64
# NOTE: we need QEMU to build Layer against a different architecture (e.g., ARM)

- name: Set up Docker Buildx
id: builder
uses: docker/setup-buildx-action@4fd812986e6c8c2a69e18311145f9371337f27d4 # v3.4.0
uses: docker/setup-buildx-action@aa33708b10e362ff993539393ff100fa93ed6a27 # v3.5.0
with:
install: true
driver: docker
Expand Down
28 changes: 20 additions & 8 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,31 +4,43 @@
<a name="unreleased"></a>
# Unreleased

## Bug Fixes

* **idempotency:** ensure in_progress_expiration field is set on Lambda timeout. ([#4773](https://github.com/aws-powertools/powertools-lambda-python/issues/4773))

## Features

* **event_handler:** add OpenAPI extensions ([#4703](https://github.com/aws-powertools/powertools-lambda-python/issues/4703))

## Maintenance

* **ci:** new pre-release 2.41.1a3 ([#4766](https://github.com/aws-powertools/powertools-lambda-python/issues/4766))
* **ci:** new pre-release 2.41.1a4 ([#4772](https://github.com/aws-powertools/powertools-lambda-python/issues/4772))
* **ci:** new pre-release 2.41.1a0 ([#4749](https://github.com/aws-powertools/powertools-lambda-python/issues/4749))
* **ci:** new pre-release 2.41.1a1 ([#4756](https://github.com/aws-powertools/powertools-lambda-python/issues/4756))
* **ci:** new pre-release 2.41.1a2 ([#4758](https://github.com/aws-powertools/powertools-lambda-python/issues/4758))
* **ci:** new pre-release 2.41.1a6 ([#4783](https://github.com/aws-powertools/powertools-lambda-python/issues/4783))
* **ci:** new pre-release 2.41.1a0 ([#4749](https://github.com/aws-powertools/powertools-lambda-python/issues/4749))
* **ci:** new pre-release 2.41.1a3 ([#4766](https://github.com/aws-powertools/powertools-lambda-python/issues/4766))
* **ci:** new pre-release 2.41.1a5 ([#4777](https://github.com/aws-powertools/powertools-lambda-python/issues/4777))
* **ci:** new pre-release 2.41.1a2 ([#4758](https://github.com/aws-powertools/powertools-lambda-python/issues/4758))
* **deps:** bump actions/dependency-review-action from 4.3.3 to 4.3.4 ([#4753](https://github.com/aws-powertools/powertools-lambda-python/issues/4753))
* **deps:** bump datadog-lambda from 6.96.0 to 6.97.0 ([#4770](https://github.com/aws-powertools/powertools-lambda-python/issues/4770))
* **deps:** bump the layer-balancer group in /layer/scripts/layer-balancer with 3 updates ([#4745](https://github.com/aws-powertools/powertools-lambda-python/issues/4745))
* **deps:** bump aws-actions/closed-issue-message from 8b6324312193476beecf11f8e8539d73a3553bf4 to 80edfc24bdf1283400eb04d20a8a605ae8bf7d48 ([#4786](https://github.com/aws-powertools/powertools-lambda-python/issues/4786))
* **deps:** bump github.com/aws/aws-sdk-go-v2/config from 1.27.26 to 1.27.27 in /layer/scripts/layer-balancer in the layer-balancer group ([#4779](https://github.com/aws-powertools/powertools-lambda-python/issues/4779))
* **deps-dev:** bump aws-cdk from 2.148.0 to 2.149.0 ([#4765](https://github.com/aws-powertools/powertools-lambda-python/issues/4765))
* **deps-dev:** bump sentry-sdk from 2.9.0 to 2.10.0 ([#4763](https://github.com/aws-powertools/powertools-lambda-python/issues/4763))
* **deps-dev:** bump cdklabs-generative-ai-cdk-constructs from 0.1.207 to 0.1.211 ([#4760](https://github.com/aws-powertools/powertools-lambda-python/issues/4760))
* **deps-dev:** bump ruff from 0.5.1 to 0.5.2 ([#4762](https://github.com/aws-powertools/powertools-lambda-python/issues/4762))
* **deps-dev:** bump mkdocs-material from 9.5.28 to 9.5.29 ([#4764](https://github.com/aws-powertools/powertools-lambda-python/issues/4764))
* **deps-dev:** bump cdklabs-generative-ai-cdk-constructs from 0.1.211 to 0.1.212 ([#4769](https://github.com/aws-powertools/powertools-lambda-python/issues/4769))
* **deps-dev:** bump cfn-lint from 1.6.0 to 1.6.1 ([#4751](https://github.com/aws-powertools/powertools-lambda-python/issues/4751))
* **deps-dev:** bump mkdocs-material from 9.5.28 to 9.5.29 ([#4764](https://github.com/aws-powertools/powertools-lambda-python/issues/4764))
* **deps-dev:** bump aws-cdk from 2.148.0 to 2.149.0 ([#4765](https://github.com/aws-powertools/powertools-lambda-python/issues/4765))
* **deps-dev:** bump pytest-asyncio from 0.23.7 to 0.23.8 ([#4776](https://github.com/aws-powertools/powertools-lambda-python/issues/4776))
* **deps-dev:** bump cfn-lint from 1.6.1 to 1.8.1 ([#4780](https://github.com/aws-powertools/powertools-lambda-python/issues/4780))
* **deps-dev:** bump cfn-lint from 1.5.3 to 1.6.0 ([#4747](https://github.com/aws-powertools/powertools-lambda-python/issues/4747))
* **deps-dev:** bump coverage from 7.5.4 to 7.6.0 ([#4746](https://github.com/aws-powertools/powertools-lambda-python/issues/4746))
* **deps-dev:** bump cdklabs-generative-ai-cdk-constructs from 0.1.206 to 0.1.207 ([#4748](https://github.com/aws-powertools/powertools-lambda-python/issues/4748))
* **deps-dev:** bump ruff from 0.5.1 to 0.5.2 ([#4762](https://github.com/aws-powertools/powertools-lambda-python/issues/4762))
* **deps-dev:** bump cdklabs-generative-ai-cdk-constructs from 0.1.207 to 0.1.211 ([#4760](https://github.com/aws-powertools/powertools-lambda-python/issues/4760))
* **deps-dev:** bump sentry-sdk from 2.9.0 to 2.10.0 ([#4763](https://github.com/aws-powertools/powertools-lambda-python/issues/4763))
* **deps-dev:** bump ruff from 0.5.2 to 0.5.3 ([#4781](https://github.com/aws-powertools/powertools-lambda-python/issues/4781))
* **deps-dev:** bump mypy-boto3-secretsmanager from 1.34.128 to 1.34.145 in the boto-typing group ([#4787](https://github.com/aws-powertools/powertools-lambda-python/issues/4787))
* **deps-dev:** bump cfn-lint from 1.8.1 to 1.8.2 ([#4788](https://github.com/aws-powertools/powertools-lambda-python/issues/4788))


<a name="v2.41.0"></a>
Expand Down
10 changes: 5 additions & 5 deletions aws_lambda_powertools/logging/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
from .logger import Logger

PACKAGE_LOGGER = "aws_lambda_powertools"
LOGGER = logging.getLogger(__name__)


def copy_config_to_registered_loggers(
Expand Down Expand Up @@ -56,7 +57,7 @@ def copy_config_to_registered_loggers(
loggers = exclude
filter_func = _exclude_registered_loggers_filter

registered_loggers = _find_registered_loggers(source_logger, loggers, filter_func)
registered_loggers = _find_registered_loggers(loggers=loggers, filter_func=filter_func)
for logger in registered_loggers:
_configure_logger(source_logger=source_logger, logger=logger, level=level, ignore_log_level=ignore_log_level)

Expand All @@ -72,13 +73,12 @@ def _exclude_registered_loggers_filter(loggers: Set[str]) -> List[logging.Logger


def _find_registered_loggers(
source_logger: Logger,
loggers: Set[str],
filter_func: Callable[[Set[str]], List[logging.Logger]],
) -> List[logging.Logger]:
"""Filter root loggers based on provided parameters."""
root_loggers = filter_func(loggers)
source_logger.debug(f"Filtered root loggers: {root_loggers}")
LOGGER.debug(f"Filtered root loggers: {root_loggers}")
return root_loggers


Expand All @@ -91,12 +91,12 @@ def _configure_logger(
# customers may not want to copy the same log level from Logger to discovered loggers
if not ignore_log_level:
logger.setLevel(level)
source_logger.debug(f"Logger {logger} reconfigured to use logging level {level}")
LOGGER.debug(f"Logger {logger} reconfigured to use logging level {level}")

logger.handlers = []
logger.propagate = False # ensure we don't propagate logs to existing loggers, #1073
source_logger.append_keys(name="%(name)s") # include logger name, see #1267

for source_handler in source_logger.handlers:
logger.addHandler(source_handler)
source_logger.debug(f"Logger {logger} reconfigured to use {source_handler}")
LOGGER.debug(f"Logger {logger} reconfigured to use {source_handler}")
2 changes: 1 addition & 1 deletion aws_lambda_powertools/shared/version.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
"""Exposes version constant to avoid circular dependencies."""

VERSION = "2.41.1a6"
VERSION = "2.41.1a7"
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,10 @@ def save_inprogress(self, data: Dict[str, Any], remaining_time_in_millis: Option
payload_hash=self._get_hashed_payload(data=data),
)

if remaining_time_in_millis:
# When Lambda kills the container after timeout, the remaining_time_in_millis is 0, which is considered False.
# Therefore, we need to check if remaining_time_in_millis is not None (>=0) to handle this case.
# See: https://github.com/aws-powertools/powertools-lambda-python/issues/4759
if remaining_time_in_millis is not None:
now = datetime.datetime.now()
period = datetime.timedelta(milliseconds=remaining_time_in_millis)
timestamp = (now + period).timestamp()
Expand Down
62 changes: 31 additions & 31 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 82ea438

Please sign in to comment.