-
Notifications
You must be signed in to change notification settings - Fork 915
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Executor] Disable long runing logging by default (#2362)
# Description Issue: #2316 This PR introduces a change to the logging behavior for long-running nodes. Previously, if a node executed for an extended period, a stack trace would be automatically logged, potentially cluttering the flow execution logs. To address this, we have now disabled long-running logging by default. Users who wish to enable logging for long-running tasks can do so by setting the PF_LONG_RUNNING_LOGGING_INTERVAL environment variable. When this variable is defined, the system will log stack traces in the specified intervals for tasks that exceed the expected runtime. ## Key Changes: * [`src/promptflow/promptflow/_constants.py`](diffhunk://#diff-0d3cf5f31883ff073bf1e11cb2e17db5cc8fe6e5e38cbb4af7b99f37ac31d41aR47-R49): Added `PF_LONG_RUNNING_LOGGING_INTERVAL` as a new environment variable. * [`src/promptflow/promptflow/_utils/utils.py`](diffhunk://#diff-d12fdd7b90cc1748f1d3e1237b4f357ba7f66740445d117beeb68ed174d1e86eR399-R420): Added `try_get_long_running_logging_interval` function to fetch and validate the logging interval from the environment variable. * [`src/promptflow/promptflow/_core/flow_execution_context.py`](diffhunk://#diff-8a45b6238b72974b62aa211aec63ef4cbeadfa8277f84525442c245a16ee4461L169-R190): Updated `invoke_tool` method to use the new logging interval. * [`src/promptflow/promptflow/executor/_async_nodes_scheduler.py`](diffhunk://#diff-aea06244ab378a5cbd47d27ba6d92c433df3089d077871b1e6aaa1b47cd3c73fR61-R66): Updated `execute` and `monitor_long_running_coroutine` methods to use the new logging interval. * [`src/promptflow/tests/executor/e2etests/test_executor_happypath.py`](diffhunk://#diff-44d4009e9df8029bb88432b7a843d3a887764cd6a67070afc49557334af3cbaaL100-R100): Updated the test to use the new environment variable. * [`src/promptflow/tests/executor/e2etests/test_logs.py`](diffhunk://#diff-1a19d8e55ebdc42bc8032fbf6025ceb4870857ef940322043695e3e8ee2847c7R156): Updated multiple tests to use the new environment variable. # All Promptflow Contribution checklist: - [x] **The pull request does not introduce [breaking changes].** - [ ] **CHANGELOG is updated for new features, bug fixes or other significant changes.** - [x] **I have read the [contribution guidelines](../CONTRIBUTING.md).** - [ ] **Create an issue and link to the pull request to get dedicated review from promptflow team. Learn more: [suggested workflow](../CONTRIBUTING.md#suggested-workflow).** ## General Guidelines and Best Practices - [x] Title of the pull request is clear and informative. - [x] There are a small number of commits, each of which have an informative message. This means that previously merged commits do not appear in the history of the PR. For more information on cleaning up the commits in your PR, [see this page](https://github.com/Azure/azure-powershell/blob/master/documentation/development-docs/cleaning-up-commits.md). ### Testing Guidelines - [x] Pull request includes test coverage for the included changes. --------- Co-authored-by: Lina Tang <[email protected]>
- Loading branch information
Showing
6 changed files
with
88 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters