[ 
https://issues.apache.org/jira/browse/AVRO-596?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12888419#action_12888419
 ] 

Scott Carey commented on AVRO-596:
----------------------------------

We need to sort out the expected behavior of Server.  IMO all these should have 
standard semantics with well documented exceptions.

AVRO-544 and AVRO-594 are related.

AVRO-544 changes HTTPServer to _not_ start when the constructor is run, but 
instead when start() is called, and join() blocks until the server exits or 
stop()/close() is called.

I favor not starting a server in a constructor.  There are several design 
patterns where you want to configure a server in one place and start it in 
another.   Furthermore, start() should not block forever, so that you can do 
things like configure and start several servers from one thread,  But there 
must be a way to know that the server is initialized -- I'm fine with start() 
blocking until its done initializing.

An isStarted() method may also be of use, in case someone closed/stopped a 
server and elsewhere one wants to check if the server is up.




> NettyServer under-initialized in constructor.
> ---------------------------------------------
>
>                 Key: AVRO-596
>                 URL: https://issues.apache.org/jira/browse/AVRO-596
>             Project: Avro
>          Issue Type: Bug
>          Components: java
>    Affects Versions: 1.3.3
>            Reporter: Patrick Linehan
>            Priority: Minor
>         Attachments: AVRO-596.patch
>
>
> As described on the dev mailing list 
> (http://mail-archives.apache.org/mod_mbox/avro-dev/201007.mbox/browser), the 
> NettyServer constructor fires off a thread to perform initialization, leaving 
> the server in an unusable state for an indeterminate amount of time.
> Suggested fix is to perform all initialization eagerly in the ctor.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to