kerneltime commented on PR #10488: URL: https://github.com/apache/ozone/pull/10488#issuecomment-4806561119
> > Also fixed my tooling to follow `AGENTS.md` (120-char limit, no early wrapping) > > I think it's still wrapping unnecessarily. Examples: > > ```java > connectionManager.addSCMServer(scmAddress, hostAndPort, > context.getThreadNamePrefix()); > ... > EndpointStateMachine endPoint = > buildScmEndpoint(address, hostAndPort, threadNamePrefix); > ``` > I did not refactor the entire PR to address the line length.. > > ```java > > // ConcurrentHashMap because addEndpoint / removeEndpoint / > > // migrateEndpoint mutate this map's KEYSET (put/remove) without > > // holding the same monitor that producers (addIncrementalReport, > > // putBackReports, getIncrementalReports) take. The producers' > > // `synchronized(incrementalReportsQueue)` blocks still guard > > // operations on the inner LinkedList values across threads -- > > // CHM only fixes the map-structure race. The metric readers > > // (getIncrementalReportQueueSize) iterate the entrySet without > > // any monitor; weakly-consistent CHM iteration is safe here. > > incrementalReportsQueue = new ConcurrentHashMap<>(); > > ``` > > Am I the only one who finds these 10+ line comments annoying? Explaining motivation for some code is OK, but for every single `ConcurrentHashMap` etc.? Code references in comments also tend to get outdated soon. Please try to find a middle ground in verbosity. With AI based code and comment generation we have some hope to keep design specs, their evolution and the documentation for the code generational rational consistent for the first time. I actually do not mind peeking into the inner thoughts of LLMs via such comments to reason about the change. Going forward we can have a repo level guideline for coding style we would like to keep. I do a future where we maintain Architecture ADRs, AI specs for generating code and verbose documentation + code in the repo and augment the CI to check for consistency issues across documentation and code. -- 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]
