Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update - move aop afterFunc to defer to ensure it must be execute #115

Merged
merged 5 commits into from
Aug 13, 2022

Conversation

NicoleRobin
Copy link
Contributor

将AfterInvoke改为放在defer中,确保即使业务逻辑存在panic也可以保证AfterInvoke一定会执行到
同时在ProxyFunction中的defer中也取消了对panic的recover,这样就避免了框架将业务产品的panic拦截掉

@CLAassistant
Copy link

CLAassistant commented Aug 10, 2022

CLA assistant check
All committers have signed the CLA.

@NicoleRobin
Copy link
Contributor Author

@LaurenceLiZhixin pls help review, tks.

@LaurenceLiZhixin
Copy link
Collaborator

@NicoleRobin ci 的 transaction 单元测试没过,在意料之内,因为 修改了 AOP 的入口判定 level 参数 :https://github.com/alibaba/IOC-golang/pull/115/files#diff-c4b7093a8266da81ecbe5084ce067eb1bfe6943d2de4ba3a2aa7f6d88848d7e8R45

本地跑一下这个ut 看看会不会出问题。

@NicoleRobin
Copy link
Contributor Author

@NicoleRobin ci 的 transaction 单元测试没过,在意料之内,因为 修改了 AOP 的入口判定 level 参数 :https://github.com/alibaba/IOC-golang/pull/115/files#diff-c4b7093a8266da81ecbe5084ce067eb1bfe6943d2de4ba3a2aa7f6d88848d7e8R45

本地跑一下这个ut 看看会不会出问题。

好的,我尝试复现并修复一下。

@NicoleRobin
Copy link
Contributor Author

已修复,原因是因为MockProxy中没有将传入进来的func参数放在defer中,导致入口判断失效了。

@LaurenceLiZhixin
Copy link
Collaborator

@NicoleRobin 感谢,我为这个pr 提交了单元测试。

@LaurenceLiZhixin LaurenceLiZhixin merged commit 25fa44a into alibaba:master Aug 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants