{"comment":{"url":"https://api.github.com/repos/topicai/dlog/comments/16491795","html_url":"https://github.com/topicai/dlog/commit/5837ca25ccd2b257d58f5985df45fd4b729cfc25#commitcomment-16491795","id":16491795,"user":{"login":"cxwangyi","id":891233,"avatar_url":"https://avatars.githubusercontent.com/u/891233?v=3","gravatar_id":"","url":"https://api.github.com/users/cxwangyi","html_url":"https://github.com/cxwangyi","followers_url":"https://api.github.com/users/cxwangyi/followers","following_url":"https://api.github.com/users/cxwangyi/following{/other_user}","gists_url":"https://api.github.com/users/cxwangyi/gists{/gist_id}","starred_url":"https://api.github.com/users/cxwangyi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cxwangyi/subscriptions","organizations_url":"https://api.github.com/users/cxwangyi/orgs","repos_url":"https://api.github.com/users/cxwangyi/repos","events_url":"https://api.github.com/users/cxwangyi/events{/privacy}","received_events_url":"https://api.github.com/users/cxwangyi/received_events","type":"User","site_admin":false},"position":83,"line":165,"path":"dlog.go","commit_id":"5837ca25ccd2b257d58f5985df45fd4b729cfc25","created_at":"2016-03-04T04:14:48Z","updated_at":"2016-03-04T04:14:48Z","body":"这里有个bug：l.retry的参数不能是*[]，而是得是[]。因为entries是定义在flush的stack里的，所以一旦flush返回了，对应的stack frame就不存在了，此时&entries就是dangling pointer了。\r\n\r\n这个bug从一个侧面说明retry逻辑和flush逻辑的密切联系——两者都调用PutRecords操作同一个slice，没有什么可以分开的。\r\n\r\n另一个侧面是，这两个函数很多代码都是重复的，逻辑上也拆不开；重复的代码的可读性也不好。所以我认为应该合在一起。"}}