[
https://issues.apache.org/jira/browse/KNOX-2157?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17006818#comment-17006818
]
Sandor Molnar commented on KNOX-2157:
-------------------------------------
I'm going to implement Jetty's {{LifeCylce.Listener}}
[interface|http://www.eclipse.org/jetty/javadoc/9.4.19.v20190610/org/eclipse/jetty/util/component/LifeCycle.Listener.html]
and write out the status (STARTING, STARTED, FAILURE, STOPPING, STOPPED) into
{{$DATA_DIR/gatewayServer.status}} file. The startup script will return 0 when
the content of this file is 'STARTED'; 1 otherwise.
I'm going to add the two new optional attributed though; there needs to be a
way to customize retry attributes.
> Knox should check if it's actually up&running
> ---------------------------------------------
>
> Key: KNOX-2157
> URL: https://issues.apache.org/jira/browse/KNOX-2157
> Project: Apache Knox
> Issue Type: New Feature
> Components: Server
> Affects Versions: 1.1.0, 1.2.0, 1.3.0
> Reporter: Sandor Molnar
> Assignee: Sandor Molnar
> Priority: Major
> Fix For: 1.4.0
>
>
> As of now, Knox returns a success code in case the process is being created.
> There should be another way to check if the server is actually up&running and
> is capable of serving incoming requests.
> My proposal is:
> * the Knox startup script should be modified to run a basic Admin API check
> in case {{--test-gateway-url}} is defined in the startup command. If this is
> blank or non-defined we fallback to the existing PID-based check
> * two more optional arguments will be defined for this feature:
> ** {{--test-gateway-retry-attempts}}: indicates the number of tries the
> startup script should execute before it fails. Defaults to 5.
> ** {{--test-gateway-retry-sleep}}: the amount of time that the test process
> will wait or sleep before a retry is issued. Defaults to 2s.
> The new-style check will use {{curl}} and will return success in case
> {{$GATEWAY_TEST_URL/gateway/admin/api/v1/version/}} returns an HTTP response
> with code 200. If this is not true; the startup script should return an error
> code.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)