> On Aug. 11, 2017, 12:11 p.m., David Radley wrote: > > distro/src/bin/atlas_config.py > > Lines 71 (patched) > > <https://reviews.apache.org/r/61561/diff/1/?file=1794995#file1794995line71> > > > > I am uncomfortable duplicating the default port values here. I suggest > > moving this logic to the java class that already has the default port values > > Richard Ding wrote: > The default ports are hard-coded in Java class: > ``` > appPort = StringUtils.isEmpty(enableTLSFlag) || > enableTLSFlag.equals("true") ? > configuration.getInt(ATLAS_SERVER_HTTPS_PORT, 21443) : > configuration.getInt(ATLAS_SERVER_HTTP_PORT, 21000); > ``` > It's also difficult to access Java class from python code. > > David Radley wrote: > hi Richard , unless you move the polling logic into Java code (in a > separate thread) - so you have more control over it. I assume the process > starts right away, but the delay is in web server code prior to it opening > the port. all the best, David. > > Richard Ding wrote: > You are right. The polling logic is in the startup python script which > has no access to Java classes. > > The process is started by the python script (atlas_start.py) and the > script has no way to know when the server initialization is complete. So > inside the startup script the best we can do is to ping the port. After > changing the code to use socket module, the code is simplified and it appears > to work well even with SSL port.
(I know this issue is closed). I think the loose coupling, python script, and making a dummy socket connection make sense (as that is basically what the end user on a browser would do). But in terms of spreading defaults across multiple places (I'm thinking docs, scripts, java source), we could do a pre-processing step which would insert and/or update ports in docs, scripts, java etc - not sure it's worth the effort though. (so won't reopen) - Nigel ----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/61561/#review182676 ----------------------------------------------------------- On Aug. 17, 2017, 12:15 a.m., Richard Ding wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/61561/ > ----------------------------------------------------------- > > (Updated Aug. 17, 2017, 12:15 a.m.) > > > Review request for atlas, David Radley, Madhan Neethiraj, and Sarath > Subramanian. > > > Bugs: ATLAS-1218 > https://issues.apache.org/jira/browse/ATLAS-1218 > > > Repository: atlas > > > Description > ------- > > This patch implements a wait_for_startup function modeled after > wait_for_shutdown function. > > > Diffs > ----- > > distro/src/bin/atlas_config.py 1be9ca2b > distro/src/bin/atlas_start.py a6a3455c > > > Diff: https://reviews.apache.org/r/61561/diff/4/ > > > Testing > ------- > > Here are the output of atlas_start and atlas_stop script: > ``` > starting atlas on port 21000 > ........................................................................................................................ > Apache Atlas Server started!!! > ``` > and > ``` > stopping atlas........ > Apache Atlas Server stopped!!! > ``` > > > Thanks, > > Richard Ding > >
