mirror of
				https://github.com/PaddlePaddle/FastDeploy.git
				synced 2025-10-31 20:02:53 +08:00 
			
		
		
		
	[Sync Code] Update vs branch (#3403)
* Pre ce modified (#3335) (#3360) * Pre ce modified (#3335) * update * update * fix * fix * update * update * update * fix * update * update * update * add ut fix pr(3367) * [Bug Fix] Fix V1 video bug (#3387) * fix stopseq error info (#3342) Co-authored-by: YuBaoku <49938469+EmmonsCurse@users.noreply.github.com> * [BugFix] Fix default log level of paddleformers (#3377) Co-authored-by: YuBaoku <49938469+EmmonsCurse@users.noreply.github.com> * [Polish Code] Remove useless notes * feat(log):add_request_and_response_log (#3392) * Optimize CI execution workflow. (#3371) (#3384) * fix * [BugFix] fix control signal release failed (#3374) * [BugFix] * [BugFix] * [BugFix] * [BugFix] * fix * fix --------- Co-authored-by: YuBaoku <49938469+EmmonsCurse@users.noreply.github.com> Co-authored-by: Jiang-Jia-Jun <163579578+Jiang-Jia-Jun@users.noreply.github.com> --------- Co-authored-by: YUNSHEN XIE <1084314248@qq.com> Co-authored-by: ming1753 <61511741+ming1753@users.noreply.github.com> Co-authored-by: JYChen <zoooo0820@qq.com> Co-authored-by: YuBaoku <49938469+EmmonsCurse@users.noreply.github.com> Co-authored-by: Jiang-Jia-Jun <jiangjiajun@baidu.com> Co-authored-by: xiaolei373 <zley373@gmail.com> Co-authored-by: ltd0924 <32387785+ltd0924@users.noreply.github.com>
This commit is contained in:
		| @@ -67,6 +67,7 @@ class ZmqClient: | ||||
|         """ | ||||
|         self.router = self.context.socket(zmq.ROUTER) | ||||
|         self.router.setsockopt(zmq.SNDHWM, self.ZMQ_SNDHWM) | ||||
|         self.router.setsockopt(zmq.ROUTER_MANDATORY, 1) | ||||
|         self.router.setsockopt(zmq.SNDTIMEO, -1) | ||||
|         self.router.bind(f"ipc://{self.router_path}") | ||||
|  | ||||
| @@ -111,7 +112,6 @@ class ZmqClient: | ||||
|         """ | ||||
|         if self.router is None: | ||||
|             raise RuntimeError("Router socket not created. Call create_router() first.") | ||||
|  | ||||
|         while self.running: | ||||
|             with self.mutex: | ||||
|                 if req_id not in self.req_dict: | ||||
| @@ -124,7 +124,11 @@ class ZmqClient: | ||||
|                         continue | ||||
|                 else: | ||||
|                     break | ||||
|  | ||||
|         if self.req_dict[req_id] == -1: | ||||
|             if data[-1].finished: | ||||
|                 with self.mutex: | ||||
|                     self.req_dict.pop(req_id, None) | ||||
|             return | ||||
|         try: | ||||
|             start_send = time.time() | ||||
|             if self.aggregate_send: | ||||
| @@ -133,7 +137,9 @@ class ZmqClient: | ||||
|                 result = msgpack.packb([response.to_dict() for response in data]) | ||||
|             self.router.send_multipart([self.req_dict[req_id], b"", result]) | ||||
|             llm_logger.debug(f"send_multipart result: {req_id} len {len(data)} elapse: {time.time()-start_send}") | ||||
|  | ||||
|         except zmq.ZMQError as e: | ||||
|             llm_logger.error(f"[{req_id}] zmq error: {e}") | ||||
|             self.req_dict[req_id] = -1 | ||||
|         except Exception as e: | ||||
|             llm_logger.error(f"Send result to zmq client failed: {e}") | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Jiang-Jia-Jun
					Jiang-Jia-Jun