Starting a product should fail if the specified / default port is in use.

Description

Reasoning

Currently, if the specified (or default) port for a product is not available during the 'run' or 'run-standalone' startup process the product is started on another free port.

There are various issues with this:

  • The product itself is not correctly configured

    • AbstractProductHandler.start begins with extractAndProcessHomeDirectory, which unpacks the application's data and then modifies it

    • At that time, the product itself has not started, which means any port conflicts have not yet been detected

    • As a result, the Product settings used to, for example, adjust the base URL configured in the application’s data (typically in its database) are wrong

  • Separate Maven goals (e.g. amps:start and amps:stop), don’t share state--so when a product comes up on a random port the stop code doesn’t know where it is

    • This leads to bad compromises, like MavenGoals.createShutdownPortsPropertiesConfiguration where we essentially defeat Cargo’s shutdown detection because we know it may not run “right”

After some discussion with Atlassian staff, and also with some of the Developer community the overall feedback suggested was that it would be preferable for AMPS to fail to start the product if the specified or default port was not free.

Behaviour 6.3.x and earlier

Prerequisites

An instance of JIRA is already running on port 2990 on a system.

Steps taken

  1. Create a Jira plugin using amps

  2. Start Jira with the plugin installed using

Results

AMPS will attempt to start Jira on the default port (2990), however when it detects that it is busy it will then start JIRA on a different port.

  • The base URL in JIRA will be set to the default / specified port (ie 2990)

  • maven goal amps:stop doesn't share state with amps:start so stop operation doesn't know where JIRA is running, and cargo's shutdown detection doesn't behave properly.

Behaviour 8.x and later

Prerequisites

An instance of JIRA is already running on port 2990 on a system.

Steps taken

  1. Create a Jira plugin using amps

  2. Start Jira with the plugin installed using

Results

AMPS will attempt to start Jira on port 2990 however when it detects it is busy, it will display a warning message advising that the specified port is busy and explaining how to start Jira on a specific port using AMPS.

Environment

None

Testing Notes

Add notes...

Assignee

Adil Bhayani

Reporter

Mel Paisley

Labels

None

Add-on Type

None

Team

None

CC

None

Risk factor

None

QA Kickoff Status

None

QA Demo Status

None

Story point estimate

None

Fix versions

Affects versions

Priority

Major
Configure