You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@accumulo.apache.org by "Christopher Tubbs (JIRA)" <ji...@apache.org> on 2015/06/10 21:29:00 UTC
[jira] [Updated] (ACCUMULO-3875) Unnecessary synchronization and
conditionals in MiniAccumuloClusterControl
[ https://issues.apache.org/jira/browse/ACCUMULO-3875?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Christopher Tubbs updated ACCUMULO-3875:
----------------------------------------
Summary: Unnecessary synchronization and conditionals in MiniAccumuloClusterControl (was: Unnecessary synchronization and conditionals in MiniAccumuloClusterControl )
> Unnecessary synchronization and conditionals in MiniAccumuloClusterControl
> --------------------------------------------------------------------------
>
> Key: ACCUMULO-3875
> URL: https://issues.apache.org/jira/browse/ACCUMULO-3875
> Project: Accumulo
> Issue Type: Bug
> Components: mini
> Affects Versions: 1.7.0
> Reporter: Josh Elser
> Assignee: Josh Elser
> Labels: coverity
> Fix For: 1.6.3, 1.7.1, 1.8.0
>
> Time Spent: 0.5h
> Remaining Estimate: 0h
>
> MiniAccumuloClusterControl has a few areas that could be cleaned up
> The following null check on {{tabletServerProcesses}} is unnecessary.
> {code}
> case TABLET_SERVER:
> if (tabletServerProcesses != null) {
> synchronized (tabletServerProcesses) {
> try {
> for (Process tserver : tabletServerProcesses) {
> try {
> cluster.stopProcessWithTimeout(tserver, 30, TimeUnit.SECONDS);
> } catch (ExecutionException e) {
> log.warn("TabletServer did not fully stop after 30 seconds", e);
> } catch (TimeoutException e) {
> log.warn("TabletServer did not fully stop after 30 seconds", e);
> } catch (InterruptedException e) {
> Thread.currentThread().interrupt();
> }
> }
> } finally {
> tabletServerProcesses.clear();
> }
> }
> }
> break;
> {code}
> {{tabletServerProcesses}} should probably be {{final}} and likely does not need to be a {{synchronizedList}} because the data structure is used for synchronization before each access anyways.
> {code}
> List<Process> tabletServerProcesses = Collections.synchronizedList(new ArrayList<Process>());
> {code}
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)