sunhk opened a new issue, #9953: URL: https://github.com/apache/dubbo/issues/9953
<!-- If you need to report a security issue please visit https://github.com/apache/dubbo/security/policy --> - [x] I have searched the [issues](https://github.com/apache/dubbo/issues) of this repository and believe that this is not a duplicate. ### Environment * Dubbo version: 2.7.15 * Operating System version: Linux * Java version: 1.8 ### Steps to reproduce this issue 若存在类使com.alibaba.fastjson.JSON.toJSONString调用异常,如: ``` public class Example implements Serializable { private static final long serialVersionUID = 493475700851136978L; private String name; public String getName() throws IllegalAccessException { if(name==null){ throw new IllegalAccessException("name is undefined"); } return name; } public static void main(String[] args) { System.out.println(JSON.toJSONString(new Example())); } } ``` 将Example作为provider方法参数。 ### Expected Behavior access log正常打印,或只报一次异常 ### Actual Behavior org.apache.dubbo.rpc.filter.AccessLogFilter#writeLogQueueToFile中processWithServiceLogger或processWithAccessKeyLogger方法调用异常,无法及时清理logQueue,使相同异常重复打印,阻断queue中后续日志打印,log queue也会随着使用逐渐充满。 dubbo 3.0未进行测试,但看代码逻辑是一样的 ``` com.alibaba.fastjson.JSONException: write javaBean error, fastjson version 1.2.70, class test.Example, method : getName at com.alibaba.fastjson.serializer.JavaBeanSerializer.write(JavaBeanSerializer.java:539) at com.alibaba.fastjson.serializer.JavaBeanSerializer.write(JavaBeanSerializer.java:149) at com.alibaba.fastjson.serializer.JSONSerializer.write(JSONSerializer.java:285) at com.alibaba.fastjson.JSON.toJSONString(JSON.java:758) at com.alibaba.fastjson.JSON.toJSONString(JSON.java:696) at com.alibaba.fastjson.JSON.toJSONString(JSON.java:661) at org.apache.dubbo.rpc.support.AccessLogData.getLogMessage(AccessLogData.java:242) at org.apache.dubbo.rpc.filter.AccessLogFilter.processWithServiceLogger(AccessLogFilter.java:175) at org.apache.dubbo.rpc.filter.AccessLogFilter.writeLogQueueToFile(AccessLogFilter.java:133) at org.apache.dubbo.rpc.filter.AccessLogFilter.writeLogToFile(AccessLogFilter.java:153) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at java.lang.Thread.run(Thread.java:748) Caused by: java.lang.IllegalAccessException: name is undefined ``` -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
