-
Notifications
You must be signed in to change notification settings - Fork 5.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Serve] Return error string from
deploy_serve_application
task (#36744
) The controller runs the deploy_serve_application task to build and run the user's Serve app. If the task raises an error, the controller will try to deserialize it when it calls ray.get() on the task's reference. If the error contains a custom dependency, the deserialization will fail, and the controller will log an error about the deserialization failing instead of the actual error itself. This change catches any error in the deploy_serve_application task itself and returns it as a string to the controller. The controller then simply logs the string. Related issue number Closes #35677 and #35678. --------- Signed-off-by: Shreyas Krishnaswamy <shrekris@anyscale.com>
- Loading branch information
1 parent
684e28b
commit 0fe1149
Showing
4 changed files
with
74 additions
and
14 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
from ray import serve | ||
import ray.cloudpickle as pickle | ||
|
||
|
||
class NonserializableException(Exception): | ||
"""This exception cannot be serialized.""" | ||
|
||
def __reduce__(self): | ||
raise RuntimeError("This exception cannot be serialized!") | ||
|
||
|
||
# Confirm that NonserializableException cannot be serialized. | ||
try: | ||
pickle.dumps(NonserializableException()) | ||
except RuntimeError as e: | ||
assert "This exception cannot be serialized!" in repr(e) | ||
|
||
raise NonserializableException("custom exception info") | ||
|
||
|
||
@serve.deployment | ||
def f(): | ||
pass | ||
|
||
|
||
app = f.bind() |
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