Skip to content

[BUG] Azure Func Python Library: AppExtensionBase - potential small memory leak #1500

Closed
@macieyng

Description

@macieyng

I'm referring to this code https://github.com/Azure/azure-functions-python-library/blob/dev/azure/functions/extension/app_extension_base.py#L65-L70

    @classmethod
    def pre_invocation_app_level(cls,
                                 logger: Logger,
                                 context: Context,
                                 func_args: typing.Dict[str, object] = {},
                                 *args,
                                 **kwargs) -> None:

and line func_args: typing.Dict[str, object] = {}, is troubling me, because code initializes default argument with mutable type. AFAIK that can cause a memory leak in general (https://docs.python-guide.org/writing/gotchas/#mutable-default-arguments), but maybe in the context how it's run it's not a problem.

Not sure if this is a real problem. My app has some memory leaks, but it's not that painful, so I wasn't investigating it much.

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions