-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[App] Resolve inconsistency where the
flow.flows
property isn't rec…
…ursive leading to flow overrides (#15466) * update * update * update * update * update * resolve attachment * update * update * update * update * update * update * update * update * update * update * update * update * update
- Loading branch information
Showing
13 changed files
with
195 additions
and
160 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -234,6 +234,18 @@ def __init__( | |
self.redis = redis.Redis(host=host, port=port, password=password) | ||
|
||
def put(self, item: Any) -> None: | ||
from lightning_app import LightningWork | ||
|
||
is_work = isinstance(item, LightningWork) | ||
|
||
# TODO: Be careful to handle with a lock if another thread needs | ||
# to access the work backend one day. | ||
# The backend isn't picklable | ||
# Raises a TypeError: cannot pickle '_thread.RLock' object | ||
if is_work: | ||
backend = item._backend | ||
item._backend = None | ||
|
||
value = pickle.dumps(item) | ||
queue_len = self.length() | ||
if queue_len >= WARNING_QUEUE_SIZE: | ||
|
@@ -252,6 +264,10 @@ def put(self, item: Any) -> None: | |
"If the issue persists, please contact [email protected]" | ||
) | ||
|
||
# The backend isn't pickable. | ||
if is_work: | ||
item._backend = backend | ||
|
||
def get(self, timeout: int = None): | ||
"""Returns the left most element of the redis queue. | ||
|
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
Oops, something went wrong.