FATE-Serving icon indicating copy to clipboard operation
FATE-Serving copied to clipboard

fix bug: urldecode difference between python & java

Open asdfsx opened this issue 2 years ago • 0 comments

flow load命令执行时,serving-server会到zookeeper中的/flow/online/transfer去查询模型地址。 fateflow 基于python实现,它写入到 zookeeper 中的地址为http%3A%2F%2F172.16.0.49%3A9380%2Fv1%2Fmodel%2Ftransfer%2Fguest~10000~guest-10000~host-20000~model%2F202210120948058502700,可以看到~保持原样。 而java在做urldecode时会将~转为%E7。这会导致原有的实现中,child.endsWith(encodeUri)永远匹配不到结果

#  child字符串:
http%3A%2F%2F172.16.0.49%3A9380%2Fv1%2Fmodel%2Ftransfer%2Fguest~10000~arbiter-10000~guest-10000~host-20000~model%2F202210180730196742980
# encodeUri字符串:
%2Fguest%7E10000%7Earbiter-10000%7Eguest-10000%7Ehost-20000%7Emodel%2F202210180730196742980

目前我的修改办法是: 对zookeeper中读取到的内容直接decode,然后和拼接好的uri进行比较。缺点就是可能会做多次的decode操作。

asdfsx avatar Oct 18 '22 11:10 asdfsx