github jina-ai/serve v3.21.0
💫 Release v3.21.0

latest releases: v3.28.0, v3.27.20, v3.27.19...
13 months ago

Release Note (3.21.0)

Release time: 2023-09-26 15:54:28

This release contains 1 new feature, 4 bug fixes, and 1 documentation improvement.

🆕 Features

Add return_type parameter to gateway streamer methods (#6027)

By default, GatewayStreamer will fetch executor input and output schemas and reconstruct docarray models dynamically. The output schemas will be used to cast the responses at the gateway level.

Although the cast responses are nearly identical to the original schemas defined at the executor level, they might fail some checks. For example, if the gateway receives a document doc from an executor with output MyDoc, the following check will fail:

assert isinstance(doc, MyDoc)

Similarly, adding doc to a DocList[MyDoc] will fail the type checks.

To prevent this, the user of a GatewayStreamer can now use the return_type parameter to explicitly specify the type that will be used to cast the response. Output responses received from gateway streamer methods will always match the specified return type.

🐞 Bug Fixes

Fix topology schema validation (#6057)

Previously, if the endpoint model schemas of different Executors in a Flow did not match exactly, the Flow would fail to start, Even if the difference was as small as a different default value, it would still give rise to this error.

We have fixed this bug by relaxing the model schema checking to only verify that the types of properties match.

Fix consensus module memory leak (#6054)

In the consensus golang module, some allocated strings were not being properly released. We have repaired this.

Document casting in Flow gateway (#6032)

This bug is related to #6027. We now use the return_type parameter in GatewayStreamer to ensure that Documents received at the gateway level are properly cast to the correct schema. This prevents validation and serialization errors that previously occurred.

Remove sandbox (#6047)

Remove support for deploying Executors in the Jina Cloud sandbox, since the sandbox has been deprecated.

📗 Documentation Improvements

  • Make example copy-pastable (#6052)

🤟 Contributors

We would like to thank all contributors to this release:

Don't miss a new serve release

NewReleases is sending notifications on new releases.