You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-dev@db.apache.org by "Kathey Marsden (JIRA)" <de...@db.apache.org> on 2006/06/29 15:17:30 UTC

[jira] Created: (DERBY-1465) NetworkServerControl.start() should throw an exception and not just print exceptions starting network server

NetworkServerControl.start() should throw an exception and not just  print  exceptions  starting network server 
----------------------------------------------------------------------------------------------------------------

         Key: DERBY-1465
         URL: http://issues.apache.org/jira/browse/DERBY-1465
     Project: Derby
        Type: Bug

  Components: Network Server  
    Versions: 10.1.2.1    
    Reporter: Kathey Marsden
    Priority: Minor


NetworkServerControl.start()  will not throw an exception  if another server is already running on the same port.    I am not sure but think perhaps this was changed at  one point to accomodate the derby.drda.startNetworkServer property  so that the embedded server could continue to boot even if the network server failed to start, but  I think this is wrong for normal usage.

http://www.nabble.com/Questions-about-Network-Server-API-Behavior-p5055814.html


-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Updated: (DERBY-1465) NetworkServerControl.start() should throw an exception and not just print exceptions if the server fails to start

Posted by "Myrna van Lunteren (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DERBY-1465?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Myrna van Lunteren updated DERBY-1465:
--------------------------------------

    Attachment: DERBY-1465.diff8

uploading patch diff8, which addresses further comments, as discussed, in the start and blockingStart methods of NetworkServerControlImpl, and the NSinSameJVMTest, but doesn't try to modify consolePropertyMessage method.

suites.all passed without mishap.

> NetworkServerControl.start() should throw an exception and not just  print  exceptions  if the server fails to start
> --------------------------------------------------------------------------------------------------------------------
>
>                 Key: DERBY-1465
>                 URL: https://issues.apache.org/jira/browse/DERBY-1465
>             Project: Derby
>          Issue Type: Bug
>          Components: Network Server
>    Affects Versions: 10.1.2.1
>            Reporter: Kathey Marsden
>            Priority: Minor
>         Attachments: DERBY-1465.diff3, DERBY-1465.diff4, DERBY-1465.diff5, DERBY-1465.diff6, DERBY-1465.diff7, DERBY-1465.diff8, DERBY-1465_diff.txt, DERBY-1465_diff.txt, DERBY-1465_stat.txt, DERBY-1465_stat.txt, releaseNote.html, releaseNote.html, releaseNote.html
>
>
> NetworkServerControl.start()  will not throw an exception  if another server is already running on the same port.    I am not sure but think perhaps this was changed at  one point to accomodate the derby.drda.startNetworkServer property  so that the embedded server could continue to boot even if the network server failed to start, but  I think this is wrong for normal usage.
> http://www.nabble.com/Questions-about-Network-Server-API-Behavior-p5055814.html

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


[jira] Updated: (DERBY-1465) NetworkServerControl.start() should throw an exception and not just print exceptions if the server fails to start

Posted by "Myrna van Lunteren (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DERBY-1465?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Myrna van Lunteren updated DERBY-1465:
--------------------------------------

    Derby Info: [Patch Available, Existing Application Impact, Release Note Needed]  (was: [Existing Application Impact, Release Note Needed])

> NetworkServerControl.start() should throw an exception and not just  print  exceptions  if the server fails to start
> --------------------------------------------------------------------------------------------------------------------
>
>                 Key: DERBY-1465
>                 URL: https://issues.apache.org/jira/browse/DERBY-1465
>             Project: Derby
>          Issue Type: Bug
>          Components: Network Server
>    Affects Versions: 10.1.2.1
>            Reporter: Kathey Marsden
>            Priority: Minor
>         Attachments: DERBY-1465.diff3, DERBY-1465.diff4, DERBY-1465.diff5, DERBY-1465.diff6, DERBY-1465_diff.txt, DERBY-1465_diff.txt, DERBY-1465_stat.txt, DERBY-1465_stat.txt, releaseNote.html, releaseNote.html, releaseNote.html
>
>
> NetworkServerControl.start()  will not throw an exception  if another server is already running on the same port.    I am not sure but think perhaps this was changed at  one point to accomodate the derby.drda.startNetworkServer property  so that the embedded server could continue to boot even if the network server failed to start, but  I think this is wrong for normal usage.
> http://www.nabble.com/Questions-about-Network-Server-API-Behavior-p5055814.html

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


[jira] Updated: (DERBY-1465) NetworkServerControl.start() should throw an exception and not just print exceptions if the server fails to start

Posted by "Kathey Marsden (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DERBY-1465?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Kathey Marsden updated DERBY-1465:
----------------------------------

    Assignee: Kathey Marsden

> NetworkServerControl.start() should throw an exception and not just  print  exceptions  if the server fails to start
> --------------------------------------------------------------------------------------------------------------------
>
>                 Key: DERBY-1465
>                 URL: https://issues.apache.org/jira/browse/DERBY-1465
>             Project: Derby
>          Issue Type: Bug
>          Components: Network Server
>    Affects Versions: 10.1.2.1
>            Reporter: Kathey Marsden
>         Assigned To: Kathey Marsden
>            Priority: Minor
>
> NetworkServerControl.start()  will not throw an exception  if another server is already running on the same port.    I am not sure but think perhaps this was changed at  one point to accomodate the derby.drda.startNetworkServer property  so that the embedded server could continue to boot even if the network server failed to start, but  I think this is wrong for normal usage.
> http://www.nabble.com/Questions-about-Network-Server-API-Behavior-p5055814.html

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


[jira] Commented: (DERBY-1465) NetworkServerControl.start() should throw an exception and not just print exceptions if the server fails to start

Posted by "Daniel John Debrunner (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DERBY-1465?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12498051 ] 

Daniel John Debrunner commented on DERBY-1465:
----------------------------------------------

Should the thread you create via this start method be a daemon thread? I couldn't really tell either way from the diff.

Is it possible to add some comments to the code you added while it's fresh in your mind? At least on the
serverStartComplete variable and its wait/notify. Give future readers some clue as to what is going on. :-)

> NetworkServerControl.start() should throw an exception and not just  print  exceptions  if the server fails to start
> --------------------------------------------------------------------------------------------------------------------
>
>                 Key: DERBY-1465
>                 URL: https://issues.apache.org/jira/browse/DERBY-1465
>             Project: Derby
>          Issue Type: Bug
>          Components: Network Server
>    Affects Versions: 10.1.2.1
>            Reporter: Kathey Marsden
>         Assigned To: Kathey Marsden
>            Priority: Minor
>             Fix For: 10.3.0.0
>
>         Attachments: DERBY-1465_diff.txt, DERBY-1465_diff.txt, DERBY-1465_stat.txt, DERBY-1465_stat.txt, releaseNote.html
>
>
> NetworkServerControl.start()  will not throw an exception  if another server is already running on the same port.    I am not sure but think perhaps this was changed at  one point to accomodate the derby.drda.startNetworkServer property  so that the embedded server could continue to boot even if the network server failed to start, but  I think this is wrong for normal usage.
> http://www.nabble.com/Questions-about-Network-Server-API-Behavior-p5055814.html

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


[jira] Commented: (DERBY-1465) NetworkServerControl.start() should throw an exception and not just print exceptions if the server fails to start

Posted by "Myrna van Lunteren (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DERBY-1465?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12652479#action_12652479 ] 

Myrna van Lunteren commented on DERBY-1465:
-------------------------------------------

I have not seen the hang anymore on my own machine; however, it seems that since my check-in of November 18, tests are hanging regularly in nightlies on windows, see: http://people.apache.org/~myrnavl/derby_test_results/main/windows/index.html

I don't understand the hang, so I don't have a solution...

I have two approaches currently;
1. check in the latest patch
2. back out my first change

Or is there someone who can spot a mistake in the (patch) code?

> NetworkServerControl.start() should throw an exception and not just  print  exceptions  if the server fails to start
> --------------------------------------------------------------------------------------------------------------------
>
>                 Key: DERBY-1465
>                 URL: https://issues.apache.org/jira/browse/DERBY-1465
>             Project: Derby
>          Issue Type: Bug
>          Components: Network Server
>    Affects Versions: 10.1.2.1
>            Reporter: Kathey Marsden
>            Priority: Minor
>         Attachments: DERBY-1465.diff3, DERBY-1465.diff4, DERBY-1465.diff5, DERBY-1465_diff.txt, DERBY-1465_diff.txt, DERBY-1465_stat.txt, DERBY-1465_stat.txt, releaseNote.html, releaseNote.html, releaseNote.html
>
>
> NetworkServerControl.start()  will not throw an exception  if another server is already running on the same port.    I am not sure but think perhaps this was changed at  one point to accomodate the derby.drda.startNetworkServer property  so that the embedded server could continue to boot even if the network server failed to start, but  I think this is wrong for normal usage.
> http://www.nabble.com/Questions-about-Network-Server-API-Behavior-p5055814.html

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


[jira] Commented: (DERBY-1465) NetworkServerControl.start() should throw an exception and not just print exceptions if the server fails to start

Posted by "Myrna van Lunteren (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DERBY-1465?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12661345#action_12661345 ] 

Myrna van Lunteren commented on DERBY-1465:
-------------------------------------------

On Dec 30, I also ran with ibm15 and ibm16 on the same machine, and although ibm16 ran through without trouble, the ibm15 run got wedged in StressMultiTest.

> NetworkServerControl.start() should throw an exception and not just  print  exceptions  if the server fails to start
> --------------------------------------------------------------------------------------------------------------------
>
>                 Key: DERBY-1465
>                 URL: https://issues.apache.org/jira/browse/DERBY-1465
>             Project: Derby
>          Issue Type: Bug
>          Components: Network Server
>    Affects Versions: 10.1.2.1
>            Reporter: Kathey Marsden
>            Assignee: Myrna van Lunteren
>            Priority: Minor
>         Attachments: DERBY-1465.diff3, DERBY-1465.diff4, DERBY-1465.diff5, DERBY-1465.diff6, DERBY-1465.diff7, DERBY-1465.diff8, DERBY-1465_diff.txt, DERBY-1465_diff.txt, DERBY-1465_stat.txt, DERBY-1465_stat.txt, releaseNote.html, releaseNote.html, releaseNote.html
>
>
> NetworkServerControl.start()  will not throw an exception  if another server is already running on the same port.    I am not sure but think perhaps this was changed at  one point to accomodate the derby.drda.startNetworkServer property  so that the embedded server could continue to boot even if the network server failed to start, but  I think this is wrong for normal usage.
> http://www.nabble.com/Questions-about-Network-Server-API-Behavior-p5055814.html

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


[jira] Commented: (DERBY-1465) NetworkServerControl.start() should throw an exception and not just print exceptions if the server fails to start

Posted by "Knut Anders Hatlen (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DERBY-1465?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12654796#action_12654796 ] 

Knut Anders Hatlen commented on DERBY-1465:
-------------------------------------------

I don't know why it hung, but since blockingStart() calls startNetworkServer() before the try/finally block, it's possible that an exception is thrown without completedBoot being set to true, which will leave the main thread waiting forever.

It also looks like #718616 did not address this comment (by Dan):
>  - There is a chance the server can fail to start but the start method will not throw any exceptions.
> This is because the waiter is notified before 'runtimeException' is set, thus the waiter may see runtimeException as null and not throw an exception.

> NetworkServerControl.start() should throw an exception and not just  print  exceptions  if the server fails to start
> --------------------------------------------------------------------------------------------------------------------
>
>                 Key: DERBY-1465
>                 URL: https://issues.apache.org/jira/browse/DERBY-1465
>             Project: Derby
>          Issue Type: Bug
>          Components: Network Server
>    Affects Versions: 10.1.2.1
>            Reporter: Kathey Marsden
>            Priority: Minor
>         Attachments: DERBY-1465.diff3, DERBY-1465.diff4, DERBY-1465.diff5, DERBY-1465_diff.txt, DERBY-1465_diff.txt, DERBY-1465_stat.txt, DERBY-1465_stat.txt, releaseNote.html, releaseNote.html, releaseNote.html
>
>
> NetworkServerControl.start()  will not throw an exception  if another server is already running on the same port.    I am not sure but think perhaps this was changed at  one point to accomodate the derby.drda.startNetworkServer property  so that the embedded server could continue to boot even if the network server failed to start, but  I think this is wrong for normal usage.
> http://www.nabble.com/Questions-about-Network-Server-API-Behavior-p5055814.html

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


[jira] Updated: (DERBY-1465) NetworkServerControl.start() should throw an exception and not just print exceptions if the server fails to start

Posted by "Myrna van Lunteren (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DERBY-1465?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Myrna van Lunteren updated DERBY-1465:
--------------------------------------

    Attachment: DERBY-1465.diff3

I'm attaching a patch for this issue...
It's basically Kathey's latest patch, but with the synchronization changes suggested by Dan, and the Thread has been made a daemon thread.
There's also some extra comments.

I tried to make DRDAServerStarter.boot carry an extra parameter, and based on that parameter, exceptions got thrown as well as logged, but the exception in the test (NSinSameJVMTest fixture testShutdown has a new test case) came from DRDAServerStarter.run (invocationException), which did not allow me to throw a standard exception. Also, I felt the code got more convoluted and expansive.

Anyone have another suggestion on how to fix this, or how Dan's comment ("maybe the code could be slightly modified to use the old thread") could be interpreted?

> NetworkServerControl.start() should throw an exception and not just  print  exceptions  if the server fails to start
> --------------------------------------------------------------------------------------------------------------------
>
>                 Key: DERBY-1465
>                 URL: https://issues.apache.org/jira/browse/DERBY-1465
>             Project: Derby
>          Issue Type: Bug
>          Components: Network Server
>    Affects Versions: 10.1.2.1
>            Reporter: Kathey Marsden
>            Priority: Minor
>         Attachments: DERBY-1465.diff3, DERBY-1465_diff.txt, DERBY-1465_diff.txt, DERBY-1465_stat.txt, DERBY-1465_stat.txt, releaseNote.html
>
>
> NetworkServerControl.start()  will not throw an exception  if another server is already running on the same port.    I am not sure but think perhaps this was changed at  one point to accomodate the derby.drda.startNetworkServer property  so that the embedded server could continue to boot even if the network server failed to start, but  I think this is wrong for normal usage.
> http://www.nabble.com/Questions-about-Network-Server-API-Behavior-p5055814.html

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


[jira] Updated: (DERBY-1465) NetworkServerControl.start() should throw an exception and not just print exceptions if the server fails to start

Posted by "Myrna van Lunteren (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DERBY-1465?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Myrna van Lunteren updated DERBY-1465:
--------------------------------------

    Attachment: releaseNote.html

Attaching a first attempt at a release note.

> NetworkServerControl.start() should throw an exception and not just  print  exceptions  if the server fails to start
> --------------------------------------------------------------------------------------------------------------------
>
>                 Key: DERBY-1465
>                 URL: https://issues.apache.org/jira/browse/DERBY-1465
>             Project: Derby
>          Issue Type: Bug
>          Components: Network Server
>    Affects Versions: 10.1.2.1
>            Reporter: Kathey Marsden
>            Priority: Minor
>         Attachments: DERBY-1465.diff3, DERBY-1465_diff.txt, DERBY-1465_diff.txt, DERBY-1465_stat.txt, DERBY-1465_stat.txt, releaseNote.html, releaseNote.html
>
>
> NetworkServerControl.start()  will not throw an exception  if another server is already running on the same port.    I am not sure but think perhaps this was changed at  one point to accomodate the derby.drda.startNetworkServer property  so that the embedded server could continue to boot even if the network server failed to start, but  I think this is wrong for normal usage.
> http://www.nabble.com/Questions-about-Network-Server-API-Behavior-p5055814.html

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


[jira] Assigned: (DERBY-1465) NetworkServerControl.start() should throw an exception and not just print exceptions if the server fails to start

Posted by "Myrna van Lunteren (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DERBY-1465?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Myrna van Lunteren reassigned DERBY-1465:
-----------------------------------------

    Assignee: Myrna van Lunteren

> NetworkServerControl.start() should throw an exception and not just  print  exceptions  if the server fails to start
> --------------------------------------------------------------------------------------------------------------------
>
>                 Key: DERBY-1465
>                 URL: https://issues.apache.org/jira/browse/DERBY-1465
>             Project: Derby
>          Issue Type: Bug
>          Components: Network Server
>    Affects Versions: 10.1.2.1
>            Reporter: Kathey Marsden
>            Assignee: Myrna van Lunteren
>            Priority: Minor
>         Attachments: DERBY-1465.diff3, DERBY-1465.diff4, DERBY-1465.diff5, DERBY-1465.diff6, DERBY-1465.diff7, DERBY-1465.diff8, DERBY-1465_diff.txt, DERBY-1465_diff.txt, DERBY-1465_stat.txt, DERBY-1465_stat.txt, releaseNote.html, releaseNote.html, releaseNote.html
>
>
> NetworkServerControl.start()  will not throw an exception  if another server is already running on the same port.    I am not sure but think perhaps this was changed at  one point to accomodate the derby.drda.startNetworkServer property  so that the embedded server could continue to boot even if the network server failed to start, but  I think this is wrong for normal usage.
> http://www.nabble.com/Questions-about-Network-Server-API-Behavior-p5055814.html

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


[jira] Commented: (DERBY-1465) NetworkServerControl.start() should throw an exception and not just print exceptions if the server fails to start

Posted by "Knut Anders Hatlen (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DERBY-1465?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12658653#action_12658653 ] 

Knut Anders Hatlen commented on DERBY-1465:
-------------------------------------------

Thanks for making the changes, Myrna.

I think the entire synchronization block, including the call to notifyAll(), should be moved out of the finally block along with the setting of completedBoot to true in blockingStart(). It's probably going to work without that change, but the setting of completedBoot and the call to notifyAll() belong together logically, so I think it would be clearer if they were located the same place in the code.

Otherwise, the patch looks good to me.

> NetworkServerControl.start() should throw an exception and not just  print  exceptions  if the server fails to start
> --------------------------------------------------------------------------------------------------------------------
>
>                 Key: DERBY-1465
>                 URL: https://issues.apache.org/jira/browse/DERBY-1465
>             Project: Derby
>          Issue Type: Bug
>          Components: Network Server
>    Affects Versions: 10.1.2.1
>            Reporter: Kathey Marsden
>            Priority: Minor
>         Attachments: DERBY-1465.diff3, DERBY-1465.diff4, DERBY-1465.diff5, DERBY-1465.diff6, DERBY-1465.diff7, DERBY-1465_diff.txt, DERBY-1465_diff.txt, DERBY-1465_stat.txt, DERBY-1465_stat.txt, releaseNote.html, releaseNote.html, releaseNote.html
>
>
> NetworkServerControl.start()  will not throw an exception  if another server is already running on the same port.    I am not sure but think perhaps this was changed at  one point to accomodate the derby.drda.startNetworkServer property  so that the embedded server could continue to boot even if the network server failed to start, but  I think this is wrong for normal usage.
> http://www.nabble.com/Questions-about-Network-Server-API-Behavior-p5055814.html

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


[jira] Updated: (DERBY-1465) NetworkServerControl.start() should throw an exception and not just print exceptions if the server fails to start

Posted by "Kathey Marsden (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DERBY-1465?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Kathey Marsden updated DERBY-1465:
----------------------------------

    Derby Categories: [High Value Fix]

> NetworkServerControl.start() should throw an exception and not just  print  exceptions  if the server fails to start
> --------------------------------------------------------------------------------------------------------------------
>
>                 Key: DERBY-1465
>                 URL: https://issues.apache.org/jira/browse/DERBY-1465
>             Project: Derby
>          Issue Type: Bug
>          Components: Network Server
>    Affects Versions: 10.1.2.1
>            Reporter: Kathey Marsden
>            Priority: Minor
>         Attachments: DERBY-1465_diff.txt, DERBY-1465_diff.txt, DERBY-1465_stat.txt, DERBY-1465_stat.txt, releaseNote.html
>
>
> NetworkServerControl.start()  will not throw an exception  if another server is already running on the same port.    I am not sure but think perhaps this was changed at  one point to accomodate the derby.drda.startNetworkServer property  so that the embedded server could continue to boot even if the network server failed to start, but  I think this is wrong for normal usage.
> http://www.nabble.com/Questions-about-Network-Server-API-Behavior-p5055814.html

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


[jira] Updated: (DERBY-1465) NetworkServerControl.start() should throw an exception and not just print exceptions if the server fails to start

Posted by "Myrna van Lunteren (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DERBY-1465?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Myrna van Lunteren updated DERBY-1465:
--------------------------------------

    Attachment: DERBY-1465hangibm15_12_29_08.txt

Attaching a java core dump of the test run that hung with ibm15. 

I only now noticed that there were a number (15 to 20) of Errors both with ibm142 and ibm15, starting with the fixture testGrantAndRevoke. But of course there is no list of these at the bottom of the output, because I killed the test run...

Unfortunately, there is no 'fail' directory, not sure why not...


> NetworkServerControl.start() should throw an exception and not just  print  exceptions  if the server fails to start
> --------------------------------------------------------------------------------------------------------------------
>
>                 Key: DERBY-1465
>                 URL: https://issues.apache.org/jira/browse/DERBY-1465
>             Project: Derby
>          Issue Type: Bug
>          Components: Network Server
>    Affects Versions: 10.1.2.1
>            Reporter: Kathey Marsden
>            Assignee: Myrna van Lunteren
>            Priority: Minor
>         Attachments: DERBY-1465.diff3, DERBY-1465.diff4, DERBY-1465.diff5, DERBY-1465.diff6, DERBY-1465.diff7, DERBY-1465.diff8, DERBY-1465_diff.txt, DERBY-1465_diff.txt, DERBY-1465_stat.txt, DERBY-1465_stat.txt, DERBY-1465hangibm142_12_29_08.txt, DERBY-1465hangibm15_12_29_08.txt, releaseNote.html, releaseNote.html, releaseNote.html
>
>
> NetworkServerControl.start()  will not throw an exception  if another server is already running on the same port.    I am not sure but think perhaps this was changed at  one point to accomodate the derby.drda.startNetworkServer property  so that the embedded server could continue to boot even if the network server failed to start, but  I think this is wrong for normal usage.
> http://www.nabble.com/Questions-about-Network-Server-API-Behavior-p5055814.html

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


[jira] Commented: (DERBY-1465) NetworkServerControl.start() should throw an exception and not just print exceptions if the server fails to start

Posted by "Myrna van Lunteren (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DERBY-1465?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12652551#action_12652551 ] 

Myrna van Lunteren commented on DERBY-1465:
-------------------------------------------

I couldn't figure out off hand where the trouble is that causes the hang. Somehow, it seems there is no ClientThread running to handle the clients' requests, and thus, the whole thing hangs - can't start a new server, can't connect to the current one, can't shut it down.

I've backed out the changes of revision 718616 with revision 722639.

Sorry for all the trouble.

> NetworkServerControl.start() should throw an exception and not just  print  exceptions  if the server fails to start
> --------------------------------------------------------------------------------------------------------------------
>
>                 Key: DERBY-1465
>                 URL: https://issues.apache.org/jira/browse/DERBY-1465
>             Project: Derby
>          Issue Type: Bug
>          Components: Network Server
>    Affects Versions: 10.1.2.1
>            Reporter: Kathey Marsden
>            Priority: Minor
>         Attachments: DERBY-1465.diff3, DERBY-1465.diff4, DERBY-1465.diff5, DERBY-1465_diff.txt, DERBY-1465_diff.txt, DERBY-1465_stat.txt, DERBY-1465_stat.txt, releaseNote.html, releaseNote.html, releaseNote.html
>
>
> NetworkServerControl.start()  will not throw an exception  if another server is already running on the same port.    I am not sure but think perhaps this was changed at  one point to accomodate the derby.drda.startNetworkServer property  so that the embedded server could continue to boot even if the network server failed to start, but  I think this is wrong for normal usage.
> http://www.nabble.com/Questions-about-Network-Server-API-Behavior-p5055814.html

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


[jira] Commented: (DERBY-1465) NetworkServerControl.start() should throw an exception and not just print exceptions if the server fails to start

Posted by "Knut Anders Hatlen (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DERBY-1465?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12659316#action_12659316 ] 

Knut Anders Hatlen commented on DERBY-1465:
-------------------------------------------

diff8 looks fine to me. +1 to commit.

> NetworkServerControl.start() should throw an exception and not just  print  exceptions  if the server fails to start
> --------------------------------------------------------------------------------------------------------------------
>
>                 Key: DERBY-1465
>                 URL: https://issues.apache.org/jira/browse/DERBY-1465
>             Project: Derby
>          Issue Type: Bug
>          Components: Network Server
>    Affects Versions: 10.1.2.1
>            Reporter: Kathey Marsden
>            Priority: Minor
>         Attachments: DERBY-1465.diff3, DERBY-1465.diff4, DERBY-1465.diff5, DERBY-1465.diff6, DERBY-1465.diff7, DERBY-1465.diff8, DERBY-1465_diff.txt, DERBY-1465_diff.txt, DERBY-1465_stat.txt, DERBY-1465_stat.txt, releaseNote.html, releaseNote.html, releaseNote.html
>
>
> NetworkServerControl.start()  will not throw an exception  if another server is already running on the same port.    I am not sure but think perhaps this was changed at  one point to accomodate the derby.drda.startNetworkServer property  so that the embedded server could continue to boot even if the network server failed to start, but  I think this is wrong for normal usage.
> http://www.nabble.com/Questions-about-Network-Server-API-Behavior-p5055814.html

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


[jira] Updated: (DERBY-1465) NetworkServerControl.start() should throw an exception and not just print exceptions if the server fails to start

Posted by "Myrna van Lunteren (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DERBY-1465?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Myrna van Lunteren updated DERBY-1465:
--------------------------------------

    Attachment: DERBY-1465hangibm142_12_29_08.txt

Attaching stack traces of the javacore dump I caused to be generated while the test was hanging in the replication test.

The db_master dir had a derby.log in it with the following:
---------------------
2008-12-30 09:05:59.447 GMT : Could not listen on port 1527 on host 0.0.0.0:
 java.net.BindException: Address already in use: NET_Bind
---------------------

This is probably one of the faster machines I run on...(2 cpu,  3.40 Ghz).


> NetworkServerControl.start() should throw an exception and not just  print  exceptions  if the server fails to start
> --------------------------------------------------------------------------------------------------------------------
>
>                 Key: DERBY-1465
>                 URL: https://issues.apache.org/jira/browse/DERBY-1465
>             Project: Derby
>          Issue Type: Bug
>          Components: Network Server
>    Affects Versions: 10.1.2.1
>            Reporter: Kathey Marsden
>            Assignee: Myrna van Lunteren
>            Priority: Minor
>         Attachments: DERBY-1465.diff3, DERBY-1465.diff4, DERBY-1465.diff5, DERBY-1465.diff6, DERBY-1465.diff7, DERBY-1465.diff8, DERBY-1465_diff.txt, DERBY-1465_diff.txt, DERBY-1465_stat.txt, DERBY-1465_stat.txt, DERBY-1465hangibm142_12_29_08.txt, releaseNote.html, releaseNote.html, releaseNote.html
>
>
> NetworkServerControl.start()  will not throw an exception  if another server is already running on the same port.    I am not sure but think perhaps this was changed at  one point to accomodate the derby.drda.startNetworkServer property  so that the embedded server could continue to boot even if the network server failed to start, but  I think this is wrong for normal usage.
> http://www.nabble.com/Questions-about-Network-Server-API-Behavior-p5055814.html

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


[jira] Updated: (DERBY-1465) NetworkServerControl.start() should throw an exception and not just print exceptions if the server fails to start

Posted by "Kathey Marsden (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DERBY-1465?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Kathey Marsden updated DERBY-1465:
----------------------------------

       Derby Info: [Existing Application Impact, Release Note Needed]  (was: [Release Note Needed, Existing Application Impact])
    Fix Version/s:     (was: 10.3.0.0)
         Assignee:     (was: Kathey Marsden)

Per Dan's recommendation, I think I will hold off on this issue until Bernt's changes go in.  Unassigning myself for now.

> NetworkServerControl.start() should throw an exception and not just  print  exceptions  if the server fails to start
> --------------------------------------------------------------------------------------------------------------------
>
>                 Key: DERBY-1465
>                 URL: https://issues.apache.org/jira/browse/DERBY-1465
>             Project: Derby
>          Issue Type: Bug
>          Components: Network Server
>    Affects Versions: 10.1.2.1
>            Reporter: Kathey Marsden
>            Priority: Minor
>         Attachments: DERBY-1465_diff.txt, DERBY-1465_diff.txt, DERBY-1465_stat.txt, DERBY-1465_stat.txt, releaseNote.html
>
>
> NetworkServerControl.start()  will not throw an exception  if another server is already running on the same port.    I am not sure but think perhaps this was changed at  one point to accomodate the derby.drda.startNetworkServer property  so that the embedded server could continue to boot even if the network server failed to start, but  I think this is wrong for normal usage.
> http://www.nabble.com/Questions-about-Network-Server-API-Behavior-p5055814.html

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


[jira] Commented: (DERBY-1465) NetworkServerControl.start() should throw an exception and not just print exceptions if the server fails to start

Posted by "John H. Embretsen (JIRA)" <de...@db.apache.org>.
    [ http://issues.apache.org/jira/browse/DERBY-1465?page=comments#action_12418481 ] 

John H. Embretsen commented on DERBY-1465:
------------------------------------------

The relationship between the Network Server API and the derby.drda.startNetworkServer property (and its related functionality) is indeed puzzling. See my comment to DERBY-1326 (June 16th), particularly observation b), for another example:

http://issues.apache.org/jira/browse/DERBY-1326#action_12416494


> NetworkServerControl.start() should throw an exception and not just  print  exceptions  if the server fails to start
> --------------------------------------------------------------------------------------------------------------------
>
>          Key: DERBY-1465
>          URL: http://issues.apache.org/jira/browse/DERBY-1465
>      Project: Derby
>         Type: Bug

>   Components: Network Server
>     Versions: 10.1.2.1
>     Reporter: Kathey Marsden
>     Priority: Minor

>
> NetworkServerControl.start()  will not throw an exception  if another server is already running on the same port.    I am not sure but think perhaps this was changed at  one point to accomodate the derby.drda.startNetworkServer property  so that the embedded server could continue to boot even if the network server failed to start, but  I think this is wrong for normal usage.
> http://www.nabble.com/Questions-about-Network-Server-API-Behavior-p5055814.html

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Commented: (DERBY-1465) NetworkServerControl.start() should throw an exception and not just print exceptions if the server fails to start

Posted by "Kathey Marsden (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DERBY-1465?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12648649#action_12648649 ] 

Kathey Marsden commented on DERBY-1465:
---------------------------------------

Applications may have only been expecting exceptions when they ping the server to see if it is is up, not from start() since start would always succeed before.  Applications need to be prepared for an exception to be thrown from start().


> NetworkServerControl.start() should throw an exception and not just  print  exceptions  if the server fails to start
> --------------------------------------------------------------------------------------------------------------------
>
>                 Key: DERBY-1465
>                 URL: https://issues.apache.org/jira/browse/DERBY-1465
>             Project: Derby
>          Issue Type: Bug
>          Components: Network Server
>    Affects Versions: 10.1.2.1
>            Reporter: Kathey Marsden
>            Priority: Minor
>         Attachments: DERBY-1465.diff3, DERBY-1465_diff.txt, DERBY-1465_diff.txt, DERBY-1465_stat.txt, DERBY-1465_stat.txt, releaseNote.html
>
>
> NetworkServerControl.start()  will not throw an exception  if another server is already running on the same port.    I am not sure but think perhaps this was changed at  one point to accomodate the derby.drda.startNetworkServer property  so that the embedded server could continue to boot even if the network server failed to start, but  I think this is wrong for normal usage.
> http://www.nabble.com/Questions-about-Network-Server-API-Behavior-p5055814.html

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


[jira] Commented: (DERBY-1465) NetworkServerControl.start() should throw an exception and not just print exceptions if the server fails to start

Posted by "Myrna van Lunteren (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DERBY-1465?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12731917#action_12731917 ] 

Myrna van Lunteren commented on DERBY-1465:
-------------------------------------------

I think this issue was possibly blocked by DERBY-4053, or perhaps DERBY-4034, or the additional bind error and hang described in https://issues.apache.org/jira/browse/DERBY-4155?focusedCommentId=12731086&page=com.atlassian.jira.plugin.system.issuetabpanels%3Acomment-tabpanel#action_12731086.


> NetworkServerControl.start() should throw an exception and not just  print  exceptions  if the server fails to start
> --------------------------------------------------------------------------------------------------------------------
>
>                 Key: DERBY-1465
>                 URL: https://issues.apache.org/jira/browse/DERBY-1465
>             Project: Derby
>          Issue Type: Bug
>          Components: Network Server
>    Affects Versions: 10.1.2.1
>            Reporter: Kathey Marsden
>            Assignee: Myrna van Lunteren
>            Priority: Minor
>         Attachments: DERBY-1465.diff3, DERBY-1465.diff4, DERBY-1465.diff5, DERBY-1465.diff6, DERBY-1465.diff7, DERBY-1465.diff8, DERBY-1465_diff.txt, DERBY-1465_diff.txt, DERBY-1465_stat.txt, DERBY-1465_stat.txt, DERBY-1465hangibm142_12_29_08.txt, DERBY-1465hangibm15_12_29_08.txt, releaseNote.html, releaseNote.html, releaseNote.html
>
>
> NetworkServerControl.start()  will not throw an exception  if another server is already running on the same port.    I am not sure but think perhaps this was changed at  one point to accomodate the derby.drda.startNetworkServer property  so that the embedded server could continue to boot even if the network server failed to start, but  I think this is wrong for normal usage.
> http://www.nabble.com/Questions-about-Network-Server-API-Behavior-p5055814.html

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


[jira] Reopened: (DERBY-1465) NetworkServerControl.start() should throw an exception and not just print exceptions if the server fails to start

Posted by "Kathey Marsden (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DERBY-1465?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Kathey Marsden reopened DERBY-1465:
-----------------------------------


There are some issues with the change noted in Dan's comments.  Backing out the change and reopen until those can be resolved.

> NetworkServerControl.start() should throw an exception and not just  print  exceptions  if the server fails to start
> --------------------------------------------------------------------------------------------------------------------
>
>                 Key: DERBY-1465
>                 URL: https://issues.apache.org/jira/browse/DERBY-1465
>             Project: Derby
>          Issue Type: Bug
>          Components: Network Server
>    Affects Versions: 10.1.2.1
>            Reporter: Kathey Marsden
>         Assigned To: Kathey Marsden
>            Priority: Minor
>             Fix For: 10.3.0.0
>
>         Attachments: DERBY-1465_diff.txt, DERBY-1465_diff.txt, DERBY-1465_stat.txt, DERBY-1465_stat.txt, releaseNote.html
>
>
> NetworkServerControl.start()  will not throw an exception  if another server is already running on the same port.    I am not sure but think perhaps this was changed at  one point to accomodate the derby.drda.startNetworkServer property  so that the embedded server could continue to boot even if the network server failed to start, but  I think this is wrong for normal usage.
> http://www.nabble.com/Questions-about-Network-Server-API-Behavior-p5055814.html

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


[jira] Updated: (DERBY-1465) NetworkServerControl.start() should throw an exception and not just print exceptions if the server fails to start

Posted by "Myrna van Lunteren (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DERBY-1465?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Myrna van Lunteren updated DERBY-1465:
--------------------------------------

    Attachment: DERBY-1465.diff5

Attaching another patch - it has only 2 differences vs. patch diff4;
1. setting runtimeException to null at the top of start (or the exception might not get cleared out)
2. add some comments

> NetworkServerControl.start() should throw an exception and not just  print  exceptions  if the server fails to start
> --------------------------------------------------------------------------------------------------------------------
>
>                 Key: DERBY-1465
>                 URL: https://issues.apache.org/jira/browse/DERBY-1465
>             Project: Derby
>          Issue Type: Bug
>          Components: Network Server
>    Affects Versions: 10.1.2.1
>            Reporter: Kathey Marsden
>            Priority: Minor
>         Attachments: DERBY-1465.diff3, DERBY-1465.diff4, DERBY-1465.diff5, DERBY-1465_diff.txt, DERBY-1465_diff.txt, DERBY-1465_stat.txt, DERBY-1465_stat.txt, releaseNote.html, releaseNote.html, releaseNote.html
>
>
> NetworkServerControl.start()  will not throw an exception  if another server is already running on the same port.    I am not sure but think perhaps this was changed at  one point to accomodate the derby.drda.startNetworkServer property  so that the embedded server could continue to boot even if the network server failed to start, but  I think this is wrong for normal usage.
> http://www.nabble.com/Questions-about-Network-Server-API-Behavior-p5055814.html

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


[jira] Commented: (DERBY-1465) NetworkServerControl.start() should throw an exception and not just print exceptions if the server fails to start

Posted by "Daniel John Debrunner (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DERBY-1465?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12498068 ] 

Daniel John Debrunner commented on DERBY-1465:
----------------------------------------------

The old thread was started as a daemon thread, in derby's daemon thread group, but this new thread isn't (for either).

I think Bryan was trying to clean up the code to start the network server, I wonder if that has progressed to be useable, because this is adding another mechanism to start the server in already confused code.

There are a couple of timing bugs in the wait code:

 - There is a chance the server can fail to start but the start method will not throw any exceptions.
This is because the waiter is notified before 'runtimeException' is set, thus the waiter may see runtimeException as null and not throw an exception.

- There is a chance the start() method will hang, if the spawned thread reaches the notifyAll() before the start() call reaches the wait().
   The standard way to avoid this is to include boolean state information, so that the sync calls are like:
            
			synchronized (serverStartComplete) {
                                completedBoot = true;
				serverStartComplete.notifyAll();
			}



      		     synchronized(serverStartComplete){
                        while (!completedBoot )
		    	      serverStartComplete.wait();
		    }

I wonder if the code could be modifed slightly to use the old thread, rather than creating a new thread ...

> NetworkServerControl.start() should throw an exception and not just  print  exceptions  if the server fails to start
> --------------------------------------------------------------------------------------------------------------------
>
>                 Key: DERBY-1465
>                 URL: https://issues.apache.org/jira/browse/DERBY-1465
>             Project: Derby
>          Issue Type: Bug
>          Components: Network Server
>    Affects Versions: 10.1.2.1
>            Reporter: Kathey Marsden
>         Assigned To: Kathey Marsden
>            Priority: Minor
>             Fix For: 10.3.0.0
>
>         Attachments: DERBY-1465_diff.txt, DERBY-1465_diff.txt, DERBY-1465_stat.txt, DERBY-1465_stat.txt, releaseNote.html
>
>
> NetworkServerControl.start()  will not throw an exception  if another server is already running on the same port.    I am not sure but think perhaps this was changed at  one point to accomodate the derby.drda.startNetworkServer property  so that the embedded server could continue to boot even if the network server failed to start, but  I think this is wrong for normal usage.
> http://www.nabble.com/Questions-about-Network-Server-API-Behavior-p5055814.html

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


[jira] Updated: (DERBY-1465) NetworkServerControl.start() should throw an exception and not just print exceptions if the server fails to start

Posted by "Kathey Marsden (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DERBY-1465?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Kathey Marsden updated DERBY-1465:
----------------------------------

    Attachment: DERBY-1465_diff.txt

Patch for this issue.  start() will now wait until the server has been started.  It will wait until just before the server started message prints to return and will throw an exception if one occurred. One possible problem with the existing.  One possible problem with the existing code is that it prints "server started" before launching the client thread.  If that needs to be moved, I will log it as a separate issue.

derbynetmats, derbynetclientmats and suites.All passed.
I'll commit this late today if I hear no comments, but I would appreciate if someone would take a look.

Thanks

Kathey

> NetworkServerControl.start() should throw an exception and not just  print  exceptions  if the server fails to start
> --------------------------------------------------------------------------------------------------------------------
>
>                 Key: DERBY-1465
>                 URL: https://issues.apache.org/jira/browse/DERBY-1465
>             Project: Derby
>          Issue Type: Bug
>          Components: Network Server
>    Affects Versions: 10.1.2.1
>            Reporter: Kathey Marsden
>         Assigned To: Kathey Marsden
>            Priority: Minor
>         Attachments: DERBY-1465_diff.txt, DERBY-1465_diff.txt, DERBY-1465_stat.txt, DERBY-1465_stat.txt
>
>
> NetworkServerControl.start()  will not throw an exception  if another server is already running on the same port.    I am not sure but think perhaps this was changed at  one point to accomodate the derby.drda.startNetworkServer property  so that the embedded server could continue to boot even if the network server failed to start, but  I think this is wrong for normal usage.
> http://www.nabble.com/Questions-about-Network-Server-API-Behavior-p5055814.html

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


[jira] Closed: (DERBY-1465) NetworkServerControl.start() should throw an exception and not just print exceptions if the server fails to start

Posted by "Myrna van Lunteren (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DERBY-1465?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Myrna van Lunteren closed DERBY-1465.
-------------------------------------

    Resolution: Won't Fix

Closing as won't fix after reporter's reconsidering.

> NetworkServerControl.start() should throw an exception and not just  print  exceptions  if the server fails to start
> --------------------------------------------------------------------------------------------------------------------
>
>                 Key: DERBY-1465
>                 URL: https://issues.apache.org/jira/browse/DERBY-1465
>             Project: Derby
>          Issue Type: Bug
>          Components: Network Server
>    Affects Versions: 10.1.2.1
>            Reporter: Kathey Marsden
>            Assignee: Myrna van Lunteren
>            Priority: Minor
>         Attachments: DERBY-1465.diff3, DERBY-1465.diff4, DERBY-1465.diff5, DERBY-1465.diff6, DERBY-1465.diff7, DERBY-1465.diff8, DERBY-1465_diff.txt, DERBY-1465_diff.txt, DERBY-1465_stat.txt, DERBY-1465_stat.txt, DERBY-1465hangibm142_12_29_08.txt, DERBY-1465hangibm15_12_29_08.txt, releaseNote.html, releaseNote.html, releaseNote.html
>
>
> NetworkServerControl.start()  will not throw an exception  if another server is already running on the same port.    I am not sure but think perhaps this was changed at  one point to accomodate the derby.drda.startNetworkServer property  so that the embedded server could continue to boot even if the network server failed to start, but  I think this is wrong for normal usage.
> http://www.nabble.com/Questions-about-Network-Server-API-Behavior-p5055814.html

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


[jira] Commented: (DERBY-1465) NetworkServerControl.start() should throw an exception and not just print exceptions if the server fails to start

Posted by "Myrna van Lunteren (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DERBY-1465?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12648375#action_12648375 ] 

Myrna van Lunteren commented on DERBY-1465:
-------------------------------------------

No suggestions/comments so far. 
suites.All ran without failures. I plan to commit this tomorrow.

> NetworkServerControl.start() should throw an exception and not just  print  exceptions  if the server fails to start
> --------------------------------------------------------------------------------------------------------------------
>
>                 Key: DERBY-1465
>                 URL: https://issues.apache.org/jira/browse/DERBY-1465
>             Project: Derby
>          Issue Type: Bug
>          Components: Network Server
>    Affects Versions: 10.1.2.1
>            Reporter: Kathey Marsden
>            Priority: Minor
>         Attachments: DERBY-1465.diff3, DERBY-1465_diff.txt, DERBY-1465_diff.txt, DERBY-1465_stat.txt, DERBY-1465_stat.txt, releaseNote.html
>
>
> NetworkServerControl.start()  will not throw an exception  if another server is already running on the same port.    I am not sure but think perhaps this was changed at  one point to accomodate the derby.drda.startNetworkServer property  so that the embedded server could continue to boot even if the network server failed to start, but  I think this is wrong for normal usage.
> http://www.nabble.com/Questions-about-Network-Server-API-Behavior-p5055814.html

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


Re: [jira] Commented: (DERBY-1465) NetworkServerControl.start() should throw an exception and not just print exceptions if the server fails to start

Posted by Kathey Marsden <km...@sbcglobal.net>.
Daniel John Debrunner wrote:
>
> Do you have a list of this "bunch" of incompatible changes?
>
> I see only one listed specific to network server in the 10.3 page.
>
> http://wiki.apache.org/db-derby/DerbyTenThreeRelease#head-8adb349ea45672ab8212f88ad40a02fda433385d 
>
>
My bad. I should not have said "bunch", but I do think  DERBY-2196 is 
significant enough that it would be good to bundle any other pending 
network server issues that might cause issues with existing apps.

Kathey




Re: [jira] Commented: (DERBY-1465) NetworkServerControl.start() should throw an exception and not just print exceptions if the server fails to start

Posted by Daniel John Debrunner <dj...@apache.org>.
Kathey Marsden (JIRA) wrote:
>     [ https://issues.apache.org/jira/browse/DERBY-1465?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12498287 ] 
> 
> Kathey Marsden commented on DERBY-1465:
> ---------------------------------------

> My hope was to get it resolved for 10.3 because we already have
> a bunch of Network Server incompatible changes

Do you have a list of this "bunch" of incompatible changes?

I see only one listed specific to network server in the 10.3 page.

http://wiki.apache.org/db-derby/DerbyTenThreeRelease#head-8adb349ea45672ab8212f88ad40a02fda433385d

It would be good to update that page with these other changes.

Thanks,
Dan.


[jira] Commented: (DERBY-1465) NetworkServerControl.start() should throw an exception and not just print exceptions if the server fails to start

Posted by "Kathey Marsden (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DERBY-1465?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12498287 ] 

Kathey Marsden commented on DERBY-1465:
---------------------------------------

Dan said
>I think Bryan was trying to clean up the code to start the network server, I wonder if that has progressed to be >useable, because this is adding another mechanism to start the server in already confused code.

I think actually it was Bernt who was working on rewriting NetworkServerControlImpl.  I agree that it makes sense to wait until that work is done and see if it perhaps resolves this issue.  My hope was to get it resolved for 10.3 because we already have a bunch of Network Server incompatible changes and if this is going to affect anyone, it is better to have one big hit with 10.3 instead of hitting users again with 10.4. Bernt do you ...
1) expect your rewrite of NetworkServerControlImpl to go in for 10.3?
2) think your changes will address this issue.

Kathey



> NetworkServerControl.start() should throw an exception and not just  print  exceptions  if the server fails to start
> --------------------------------------------------------------------------------------------------------------------
>
>                 Key: DERBY-1465
>                 URL: https://issues.apache.org/jira/browse/DERBY-1465
>             Project: Derby
>          Issue Type: Bug
>          Components: Network Server
>    Affects Versions: 10.1.2.1
>            Reporter: Kathey Marsden
>         Assigned To: Kathey Marsden
>            Priority: Minor
>             Fix For: 10.3.0.0
>
>         Attachments: DERBY-1465_diff.txt, DERBY-1465_diff.txt, DERBY-1465_stat.txt, DERBY-1465_stat.txt, releaseNote.html
>
>
> NetworkServerControl.start()  will not throw an exception  if another server is already running on the same port.    I am not sure but think perhaps this was changed at  one point to accomodate the derby.drda.startNetworkServer property  so that the embedded server could continue to boot even if the network server failed to start, but  I think this is wrong for normal usage.
> http://www.nabble.com/Questions-about-Network-Server-API-Behavior-p5055814.html

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


[jira] Commented: (DERBY-1465) NetworkServerControl.start() should throw an exception and not just print exceptions if the server fails to start

Posted by "Myrna van Lunteren (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DERBY-1465?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12659141#action_12659141 ] 

Myrna van Lunteren commented on DERBY-1465:
-------------------------------------------

Yes, it would be better if consolePropertyMessage passed on the underlying Exception.

I'll create one last patch modifying just the start and blockingStart methods and changing the test - then (after one more test cycle) commit that.

I can then look into the consolePropertyMessage change - and will decide then whether to do it as part of this issue in a follow up commit or log a new issue.


> NetworkServerControl.start() should throw an exception and not just  print  exceptions  if the server fails to start
> --------------------------------------------------------------------------------------------------------------------
>
>                 Key: DERBY-1465
>                 URL: https://issues.apache.org/jira/browse/DERBY-1465
>             Project: Derby
>          Issue Type: Bug
>          Components: Network Server
>    Affects Versions: 10.1.2.1
>            Reporter: Kathey Marsden
>            Priority: Minor
>         Attachments: DERBY-1465.diff3, DERBY-1465.diff4, DERBY-1465.diff5, DERBY-1465.diff6, DERBY-1465.diff7, DERBY-1465_diff.txt, DERBY-1465_diff.txt, DERBY-1465_stat.txt, DERBY-1465_stat.txt, releaseNote.html, releaseNote.html, releaseNote.html
>
>
> NetworkServerControl.start()  will not throw an exception  if another server is already running on the same port.    I am not sure but think perhaps this was changed at  one point to accomodate the derby.drda.startNetworkServer property  so that the embedded server could continue to boot even if the network server failed to start, but  I think this is wrong for normal usage.
> http://www.nabble.com/Questions-about-Network-Server-API-Behavior-p5055814.html

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


[jira] Updated: (DERBY-1465) NetworkServerControl.start() should throw an exception and not just print exceptions if the server fails to start

Posted by "Myrna van Lunteren (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DERBY-1465?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Myrna van Lunteren updated DERBY-1465:
--------------------------------------

    Attachment: DERBY-1465.diff7

Thanks for the suggestions.

I implemented them with this latest patch.
I saw no new failures with this and no hangs.

> NetworkServerControl.start() should throw an exception and not just  print  exceptions  if the server fails to start
> --------------------------------------------------------------------------------------------------------------------
>
>                 Key: DERBY-1465
>                 URL: https://issues.apache.org/jira/browse/DERBY-1465
>             Project: Derby
>          Issue Type: Bug
>          Components: Network Server
>    Affects Versions: 10.1.2.1
>            Reporter: Kathey Marsden
>            Priority: Minor
>         Attachments: DERBY-1465.diff3, DERBY-1465.diff4, DERBY-1465.diff5, DERBY-1465.diff6, DERBY-1465.diff7, DERBY-1465_diff.txt, DERBY-1465_diff.txt, DERBY-1465_stat.txt, DERBY-1465_stat.txt, releaseNote.html, releaseNote.html, releaseNote.html
>
>
> NetworkServerControl.start()  will not throw an exception  if another server is already running on the same port.    I am not sure but think perhaps this was changed at  one point to accomodate the derby.drda.startNetworkServer property  so that the embedded server could continue to boot even if the network server failed to start, but  I think this is wrong for normal usage.
> http://www.nabble.com/Questions-about-Network-Server-API-Behavior-p5055814.html

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


[jira] Updated: (DERBY-1465) NetworkServerControl.start() should throw an exception and not just print exceptions if the server fails to start

Posted by "Kathey Marsden (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DERBY-1465?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Kathey Marsden updated DERBY-1465:
----------------------------------

    Derby Info: [Patch Available, Existing Application Impact]  (was: [Existing Application Impact])

> NetworkServerControl.start() should throw an exception and not just  print  exceptions  if the server fails to start
> --------------------------------------------------------------------------------------------------------------------
>
>                 Key: DERBY-1465
>                 URL: https://issues.apache.org/jira/browse/DERBY-1465
>             Project: Derby
>          Issue Type: Bug
>          Components: Network Server
>    Affects Versions: 10.1.2.1
>            Reporter: Kathey Marsden
>         Assigned To: Kathey Marsden
>            Priority: Minor
>         Attachments: DERBY-1465_diff.txt, DERBY-1465_diff.txt, DERBY-1465_stat.txt, DERBY-1465_stat.txt, releaseNote.html
>
>
> NetworkServerControl.start()  will not throw an exception  if another server is already running on the same port.    I am not sure but think perhaps this was changed at  one point to accomodate the derby.drda.startNetworkServer property  so that the embedded server could continue to boot even if the network server failed to start, but  I think this is wrong for normal usage.
> http://www.nabble.com/Questions-about-Network-Server-API-Behavior-p5055814.html

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


[jira] Updated: (DERBY-1465) NetworkServerControl.start() should throw an exception and not just print exceptions if the server fails to start

Posted by "Kathey Marsden (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DERBY-1465?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Kathey Marsden updated DERBY-1465:
----------------------------------

    Attachment: DERBY-1465_stat.txt

> NetworkServerControl.start() should throw an exception and not just  print  exceptions  if the server fails to start
> --------------------------------------------------------------------------------------------------------------------
>
>                 Key: DERBY-1465
>                 URL: https://issues.apache.org/jira/browse/DERBY-1465
>             Project: Derby
>          Issue Type: Bug
>          Components: Network Server
>    Affects Versions: 10.1.2.1
>            Reporter: Kathey Marsden
>         Assigned To: Kathey Marsden
>            Priority: Minor
>         Attachments: DERBY-1465_diff.txt, DERBY-1465_diff.txt, DERBY-1465_stat.txt, DERBY-1465_stat.txt
>
>
> NetworkServerControl.start()  will not throw an exception  if another server is already running on the same port.    I am not sure but think perhaps this was changed at  one point to accomodate the derby.drda.startNetworkServer property  so that the embedded server could continue to boot even if the network server failed to start, but  I think this is wrong for normal usage.
> http://www.nabble.com/Questions-about-Network-Server-API-Behavior-p5055814.html

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


[jira] Commented: (DERBY-1465) NetworkServerControl.start() should throw an exception and not just print exceptions if the server fails to start

Posted by "Kathey Marsden (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DERBY-1465?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12648782#action_12648782 ] 

Kathey Marsden commented on DERBY-1465:
---------------------------------------

Release note looks fine to me.


> NetworkServerControl.start() should throw an exception and not just  print  exceptions  if the server fails to start
> --------------------------------------------------------------------------------------------------------------------
>
>                 Key: DERBY-1465
>                 URL: https://issues.apache.org/jira/browse/DERBY-1465
>             Project: Derby
>          Issue Type: Bug
>          Components: Network Server
>    Affects Versions: 10.1.2.1
>            Reporter: Kathey Marsden
>            Priority: Minor
>         Attachments: DERBY-1465.diff3, DERBY-1465_diff.txt, DERBY-1465_diff.txt, DERBY-1465_stat.txt, DERBY-1465_stat.txt, releaseNote.html, releaseNote.html, releaseNote.html
>
>
> NetworkServerControl.start()  will not throw an exception  if another server is already running on the same port.    I am not sure but think perhaps this was changed at  one point to accomodate the derby.drda.startNetworkServer property  so that the embedded server could continue to boot even if the network server failed to start, but  I think this is wrong for normal usage.
> http://www.nabble.com/Questions-about-Network-Server-API-Behavior-p5055814.html

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


[jira] Commented: (DERBY-1465) NetworkServerControl.start() should throw an exception and not just print exceptions if the server fails to start

Posted by "Ole Solberg (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DERBY-1465?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12652511#action_12652511 ] 

Ole Solberg commented on DERBY-1465:
------------------------------------

I am also seeing this, after November 18, on 

Red Hat Enterprise Linux AS release 4 (Nahant Update 3) 64bits
Linux 2.6.9-34.ELsmp #1 SMP Fri Feb 24 16:56:28 EST 2006 GNU/Linux
and
Solaris 10 5/08 s10x_u5wos_10 X86 64bits
SunOS 5.10 Generic_127128-11

with
Sun Microsystems Inc.
java version "1.5.0_14"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_14-b03)
Java HotSpot(TM) Client VM (build 1.5.0_14-b03, mixed mode)

See e.g.
http://dbtg.thresher.com/derby/test/trunk15/jvm1.5/testing/testlog/SunOS-5.10_i86pc-i386/722171-org.apache.derbyTesting.functionTests.suites.All_diff.txt


> NetworkServerControl.start() should throw an exception and not just  print  exceptions  if the server fails to start
> --------------------------------------------------------------------------------------------------------------------
>
>                 Key: DERBY-1465
>                 URL: https://issues.apache.org/jira/browse/DERBY-1465
>             Project: Derby
>          Issue Type: Bug
>          Components: Network Server
>    Affects Versions: 10.1.2.1
>            Reporter: Kathey Marsden
>            Priority: Minor
>         Attachments: DERBY-1465.diff3, DERBY-1465.diff4, DERBY-1465.diff5, DERBY-1465_diff.txt, DERBY-1465_diff.txt, DERBY-1465_stat.txt, DERBY-1465_stat.txt, releaseNote.html, releaseNote.html, releaseNote.html
>
>
> NetworkServerControl.start()  will not throw an exception  if another server is already running on the same port.    I am not sure but think perhaps this was changed at  one point to accomodate the derby.drda.startNetworkServer property  so that the embedded server could continue to boot even if the network server failed to start, but  I think this is wrong for normal usage.
> http://www.nabble.com/Questions-about-Network-Server-API-Behavior-p5055814.html

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


[jira] Commented: (DERBY-1465) NetworkServerControl.start() should throw an exception and not just print exceptions if the server fails to start

Posted by "Myrna van Lunteren (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DERBY-1465?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12659007#action_12659007 ] 

Myrna van Lunteren commented on DERBY-1465:
-------------------------------------------

I'm still looking at the previous comment, but the last comment throws me for a loop.

In the latest patch, using the exceptionHolder array as suggested and not using a global variable to hold the exception, we do not know what kind of exception it is in the start() method. So we can't actually check for the BindException class in the test, all we have there is a java.lang.Exception.

When we use a global variable (we used runtimeException in earlier patches), and assign the Exception underlying the PrivilegedActionException at the top of the privilegedException block to it, then the cause of the Exception, at least  for IOExceptions (i.e. in the case of the java.net.BindException the test is forcing) is saved off. Like so:
		} catch (PrivilegedActionException e) {
			Exception e1 = e.getException();
			runtimeException = e1;

I could reinstate the runtimeException, and in the start() method do some tomfoolery like:
                        if (runtimeException != null)
                            exceptionHolder[0] = runtimeException;
                        else
                            exceptionHolder[0] = e; 
Then I can check for the bindException instance in the test...But that's reintroducing the global variable...
What is the better approach?
I do like the fact that with the global variable you can actually check for IOExceptions in the test (and thus app) code, gives more info/control...But maybe it's enough to have an Exception?


> NetworkServerControl.start() should throw an exception and not just  print  exceptions  if the server fails to start
> --------------------------------------------------------------------------------------------------------------------
>
>                 Key: DERBY-1465
>                 URL: https://issues.apache.org/jira/browse/DERBY-1465
>             Project: Derby
>          Issue Type: Bug
>          Components: Network Server
>    Affects Versions: 10.1.2.1
>            Reporter: Kathey Marsden
>            Priority: Minor
>         Attachments: DERBY-1465.diff3, DERBY-1465.diff4, DERBY-1465.diff5, DERBY-1465.diff6, DERBY-1465.diff7, DERBY-1465_diff.txt, DERBY-1465_diff.txt, DERBY-1465_stat.txt, DERBY-1465_stat.txt, releaseNote.html, releaseNote.html, releaseNote.html
>
>
> NetworkServerControl.start()  will not throw an exception  if another server is already running on the same port.    I am not sure but think perhaps this was changed at  one point to accomodate the derby.drda.startNetworkServer property  so that the embedded server could continue to boot even if the network server failed to start, but  I think this is wrong for normal usage.
> http://www.nabble.com/Questions-about-Network-Server-API-Behavior-p5055814.html

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


[jira] Updated: (DERBY-1465) NetworkServerControl.start() should throw an exception and not just print exceptions if the server fails to start

Posted by "Myrna van Lunteren (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DERBY-1465?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Myrna van Lunteren updated DERBY-1465:
--------------------------------------

    Urgency: Normal

> NetworkServerControl.start() should throw an exception and not just  print  exceptions  if the server fails to start
> --------------------------------------------------------------------------------------------------------------------
>
>                 Key: DERBY-1465
>                 URL: https://issues.apache.org/jira/browse/DERBY-1465
>             Project: Derby
>          Issue Type: Bug
>          Components: Network Server
>    Affects Versions: 10.1.2.1
>            Reporter: Kathey Marsden
>            Assignee: Myrna van Lunteren
>            Priority: Minor
>         Attachments: DERBY-1465.diff3, DERBY-1465.diff4, DERBY-1465.diff5, DERBY-1465.diff6, DERBY-1465.diff7, DERBY-1465.diff8, DERBY-1465_diff.txt, DERBY-1465_diff.txt, DERBY-1465_stat.txt, DERBY-1465_stat.txt, DERBY-1465hangibm142_12_29_08.txt, DERBY-1465hangibm15_12_29_08.txt, releaseNote.html, releaseNote.html, releaseNote.html
>
>
> NetworkServerControl.start()  will not throw an exception  if another server is already running on the same port.    I am not sure but think perhaps this was changed at  one point to accomodate the derby.drda.startNetworkServer property  so that the embedded server could continue to boot even if the network server failed to start, but  I think this is wrong for normal usage.
> http://www.nabble.com/Questions-about-Network-Server-API-Behavior-p5055814.html

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


[jira] Updated: (DERBY-1465) NetworkServerControl.start() should throw an exception and not just print exceptions if the server fails to start

Posted by "Dag H. Wanvik (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DERBY-1465?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Dag H. Wanvik updated DERBY-1465:
---------------------------------

    Issue & fix info: [High Value Fix, Release Note Needed]  (was: [High Value Fix])

> NetworkServerControl.start() should throw an exception and not just  print  exceptions  if the server fails to start
> --------------------------------------------------------------------------------------------------------------------
>
>                 Key: DERBY-1465
>                 URL: https://issues.apache.org/jira/browse/DERBY-1465
>             Project: Derby
>          Issue Type: Bug
>          Components: Network Server
>    Affects Versions: 10.1.2.1
>            Reporter: Kathey Marsden
>            Assignee: Myrna van Lunteren
>            Priority: Minor
>         Attachments: DERBY-1465.diff3, DERBY-1465.diff4, DERBY-1465.diff5, DERBY-1465.diff6, DERBY-1465.diff7, DERBY-1465.diff8, DERBY-1465_diff.txt, DERBY-1465_diff.txt, DERBY-1465_stat.txt, DERBY-1465_stat.txt, DERBY-1465hangibm142_12_29_08.txt, DERBY-1465hangibm15_12_29_08.txt, releaseNote.html, releaseNote.html, releaseNote.html
>
>
> NetworkServerControl.start()  will not throw an exception  if another server is already running on the same port.    I am not sure but think perhaps this was changed at  one point to accomodate the derby.drda.startNetworkServer property  so that the embedded server could continue to boot even if the network server failed to start, but  I think this is wrong for normal usage.
> http://www.nabble.com/Questions-about-Network-Server-API-Behavior-p5055814.html

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


[jira] Updated: (DERBY-1465) NetworkServerControl.start() should throw an exception and not just print exceptions if the server fails to start

Posted by "Kathey Marsden (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DERBY-1465?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Kathey Marsden updated DERBY-1465:
----------------------------------


The patch attached has a conflict with DERBY-2671, so needs to be redone.  Ignore the patch DERBY-1465_diff.txt



> NetworkServerControl.start() should throw an exception and not just  print  exceptions  if the server fails to start
> --------------------------------------------------------------------------------------------------------------------
>
>                 Key: DERBY-1465
>                 URL: https://issues.apache.org/jira/browse/DERBY-1465
>             Project: Derby
>          Issue Type: Bug
>          Components: Network Server
>    Affects Versions: 10.1.2.1
>            Reporter: Kathey Marsden
>         Assigned To: Kathey Marsden
>            Priority: Minor
>         Attachments: DERBY-1465_diff.txt, DERBY-1465_stat.txt
>
>
> NetworkServerControl.start()  will not throw an exception  if another server is already running on the same port.    I am not sure but think perhaps this was changed at  one point to accomodate the derby.drda.startNetworkServer property  so that the embedded server could continue to boot even if the network server failed to start, but  I think this is wrong for normal usage.
> http://www.nabble.com/Questions-about-Network-Server-API-Behavior-p5055814.html

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


[jira] Commented: (DERBY-1465) NetworkServerControl.start() should throw an exception and not just print exceptions if the server fails to start

Posted by "Myrna van Lunteren (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DERBY-1465?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12648611#action_12648611 ] 

Myrna van Lunteren commented on DERBY-1465:
-------------------------------------------

I committed the latest patch with revision 718616.

Now - this issue has 'release note needed' flagged, but I'm not certain why
It does need to be in the release notes, of course, but does this need a special explanation? It seems to me, that either way, the server is not started (as it's already started), and we're still also printing the exceptions, so I have some trouble seeing how this could affect existing applications. Any thoughts?


> NetworkServerControl.start() should throw an exception and not just  print  exceptions  if the server fails to start
> --------------------------------------------------------------------------------------------------------------------
>
>                 Key: DERBY-1465
>                 URL: https://issues.apache.org/jira/browse/DERBY-1465
>             Project: Derby
>          Issue Type: Bug
>          Components: Network Server
>    Affects Versions: 10.1.2.1
>            Reporter: Kathey Marsden
>            Priority: Minor
>         Attachments: DERBY-1465.diff3, DERBY-1465_diff.txt, DERBY-1465_diff.txt, DERBY-1465_stat.txt, DERBY-1465_stat.txt, releaseNote.html
>
>
> NetworkServerControl.start()  will not throw an exception  if another server is already running on the same port.    I am not sure but think perhaps this was changed at  one point to accomodate the derby.drda.startNetworkServer property  so that the embedded server could continue to boot even if the network server failed to start, but  I think this is wrong for normal usage.
> http://www.nabble.com/Questions-about-Network-Server-API-Behavior-p5055814.html

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


[jira] Updated: (DERBY-1465) NetworkServerControl.start() should throw an exception and not just print exceptions if the server fails to start

Posted by "Kathey Marsden (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DERBY-1465?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Kathey Marsden updated DERBY-1465:
----------------------------------

    Attachment: releaseNote.html

> NetworkServerControl.start() should throw an exception and not just  print  exceptions  if the server fails to start
> --------------------------------------------------------------------------------------------------------------------
>
>                 Key: DERBY-1465
>                 URL: https://issues.apache.org/jira/browse/DERBY-1465
>             Project: Derby
>          Issue Type: Bug
>          Components: Network Server
>    Affects Versions: 10.1.2.1
>            Reporter: Kathey Marsden
>         Assigned To: Kathey Marsden
>            Priority: Minor
>         Attachments: DERBY-1465_diff.txt, DERBY-1465_diff.txt, DERBY-1465_stat.txt, DERBY-1465_stat.txt, releaseNote.html
>
>
> NetworkServerControl.start()  will not throw an exception  if another server is already running on the same port.    I am not sure but think perhaps this was changed at  one point to accomodate the derby.drda.startNetworkServer property  so that the embedded server could continue to boot even if the network server failed to start, but  I think this is wrong for normal usage.
> http://www.nabble.com/Questions-about-Network-Server-API-Behavior-p5055814.html

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


[jira] Commented: (DERBY-1465) NetworkServerControl.start() should throw an exception and not just print exceptions if the server fails to start

Posted by "Myrna van Lunteren (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DERBY-1465?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12659585#action_12659585 ] 

Myrna van Lunteren commented on DERBY-1465:
-------------------------------------------

I committed diff8 with revision 729933. If no hangs are reported in a week I'll consider this part done...

> NetworkServerControl.start() should throw an exception and not just  print  exceptions  if the server fails to start
> --------------------------------------------------------------------------------------------------------------------
>
>                 Key: DERBY-1465
>                 URL: https://issues.apache.org/jira/browse/DERBY-1465
>             Project: Derby
>          Issue Type: Bug
>          Components: Network Server
>    Affects Versions: 10.1.2.1
>            Reporter: Kathey Marsden
>            Priority: Minor
>         Attachments: DERBY-1465.diff3, DERBY-1465.diff4, DERBY-1465.diff5, DERBY-1465.diff6, DERBY-1465.diff7, DERBY-1465.diff8, DERBY-1465_diff.txt, DERBY-1465_diff.txt, DERBY-1465_stat.txt, DERBY-1465_stat.txt, releaseNote.html, releaseNote.html, releaseNote.html
>
>
> NetworkServerControl.start()  will not throw an exception  if another server is already running on the same port.    I am not sure but think perhaps this was changed at  one point to accomodate the derby.drda.startNetworkServer property  so that the embedded server could continue to boot even if the network server failed to start, but  I think this is wrong for normal usage.
> http://www.nabble.com/Questions-about-Network-Server-API-Behavior-p5055814.html

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


[jira] Commented: (DERBY-1465) NetworkServerControl.start() should throw an exception and not just print exceptions if the server fails to start

Posted by "Knut Anders Hatlen (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DERBY-1465?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12657045#action_12657045 ] 

Knut Anders Hatlen commented on DERBY-1465:
-------------------------------------------

In patch 6, completedBoot is set to true in the catch block in
startNetworkServer() after consolePropertyMessage() has been
called. If I understand the code in consolePropertyMessage()
correctly, it will in many cases throw an exception in addition to
printing a message to the console, in which case completedBoot is not
set to true. And I guess notifyAll() would have to be called there as
well.

Should completedBoot also be reset when runtimeException is reset?

Perhaps this is a more robust approach:

  1) Remove the runtimeException instance variable, and don't set it
     in blockingStart()

  2) Move the setting of completedBoot out of the finally block in
  blockingStart(), and don't set it in startNetworkServer(), so that
  it's only set if there was no error

  3) Put this in the start() method:

    completedBoot = false; // reset before we boot
    final Exception[] exceptionHolder = new Exception[1];
    .
    .
    .
    Thread t = new Thread("NetworkServerControl") {
        public void run() {
            try {
                blockingStart(consoleWriter);
            } catch (Exception e) {
                synchronized (serverStartComplete) {
                    exceptionHolder[0] = e;
                    serverStartComplete.notifyAll();
                }
            }
        }
    };
    .
    .
    .
    t.start();
    // wait until the server has started successfully
    // or an error has been detected
    synchronized (serverStartComplete) {
        while (!completedBoot && exceptionHolder[0] == null) {
            serverStartComplete.wait();
        }
    }
    if (!completedBoot) {
        // boot was not successful, throw the exception
        throw exceptionHolder[0];
    }

With this approach, we make the tracking of the exception simpler (all
exception handling is local to the start() method), and since
completedBoot is only set on successful boot, we don't need to track
down all error paths where it needs to be set.

> NetworkServerControl.start() should throw an exception and not just  print  exceptions  if the server fails to start
> --------------------------------------------------------------------------------------------------------------------
>
>                 Key: DERBY-1465
>                 URL: https://issues.apache.org/jira/browse/DERBY-1465
>             Project: Derby
>          Issue Type: Bug
>          Components: Network Server
>    Affects Versions: 10.1.2.1
>            Reporter: Kathey Marsden
>            Priority: Minor
>         Attachments: DERBY-1465.diff3, DERBY-1465.diff4, DERBY-1465.diff5, DERBY-1465.diff6, DERBY-1465_diff.txt, DERBY-1465_diff.txt, DERBY-1465_stat.txt, DERBY-1465_stat.txt, releaseNote.html, releaseNote.html, releaseNote.html
>
>
> NetworkServerControl.start()  will not throw an exception  if another server is already running on the same port.    I am not sure but think perhaps this was changed at  one point to accomodate the derby.drda.startNetworkServer property  so that the embedded server could continue to boot even if the network server failed to start, but  I think this is wrong for normal usage.
> http://www.nabble.com/Questions-about-Network-Server-API-Behavior-p5055814.html

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


[jira] Commented: (DERBY-1465) NetworkServerControl.start() should throw an exception and not just print exceptions if the server fails to start

Posted by "Kathey Marsden (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DERBY-1465?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12498057 ] 

Kathey Marsden commented on DERBY-1465:
---------------------------------------

Thanks Dan for looking.

I don't think it should be a daemon thread if I understand the concept of a daemon thread correctly.  I don't want the jvm to exit while this thread is running.   I'll add comments for serverStartComplete.



> NetworkServerControl.start() should throw an exception and not just  print  exceptions  if the server fails to start
> --------------------------------------------------------------------------------------------------------------------
>
>                 Key: DERBY-1465
>                 URL: https://issues.apache.org/jira/browse/DERBY-1465
>             Project: Derby
>          Issue Type: Bug
>          Components: Network Server
>    Affects Versions: 10.1.2.1
>            Reporter: Kathey Marsden
>         Assigned To: Kathey Marsden
>            Priority: Minor
>             Fix For: 10.3.0.0
>
>         Attachments: DERBY-1465_diff.txt, DERBY-1465_diff.txt, DERBY-1465_stat.txt, DERBY-1465_stat.txt, releaseNote.html
>
>
> NetworkServerControl.start()  will not throw an exception  if another server is already running on the same port.    I am not sure but think perhaps this was changed at  one point to accomodate the derby.drda.startNetworkServer property  so that the embedded server could continue to boot even if the network server failed to start, but  I think this is wrong for normal usage.
> http://www.nabble.com/Questions-about-Network-Server-API-Behavior-p5055814.html

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


[jira] Updated: (DERBY-1465) NetworkServerControl.start() should throw an exception and not just print exceptions if the server fails to start

Posted by "Kathey Marsden (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DERBY-1465?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Kathey Marsden updated DERBY-1465:
----------------------------------

    Attachment: DERBY-1465_stat.txt

> NetworkServerControl.start() should throw an exception and not just  print  exceptions  if the server fails to start
> --------------------------------------------------------------------------------------------------------------------
>
>                 Key: DERBY-1465
>                 URL: https://issues.apache.org/jira/browse/DERBY-1465
>             Project: Derby
>          Issue Type: Bug
>          Components: Network Server
>    Affects Versions: 10.1.2.1
>            Reporter: Kathey Marsden
>         Assigned To: Kathey Marsden
>            Priority: Minor
>         Attachments: DERBY-1465_diff.txt, DERBY-1465_stat.txt
>
>
> NetworkServerControl.start()  will not throw an exception  if another server is already running on the same port.    I am not sure but think perhaps this was changed at  one point to accomodate the derby.drda.startNetworkServer property  so that the embedded server could continue to boot even if the network server failed to start, but  I think this is wrong for normal usage.
> http://www.nabble.com/Questions-about-Network-Server-API-Behavior-p5055814.html

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


[jira] Commented: (DERBY-1465) NetworkServerControl.start() should throw an exception and not just print exceptions if the server fails to start

Posted by "Knut Anders Hatlen (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DERBY-1465?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12658655#action_12658655 ] 

Knut Anders Hatlen commented on DERBY-1465:
-------------------------------------------

Just one tiny nit in the test. We have this code:

+        } catch (Exception e) {
+            assertTrue(e.getMessage().indexOf("java.net.BindException") > 1);
+        }

Perhaps it's better with something like this (untested):

catch (Exception e) {
    boolean ok = false;
    for (Throwable t = e; t != null; t = t.getCause()) {
        if (t instanceof java.net.BindException) {
            ok = true;
            break;
        }
    }
    if (!ok) {
        throw e;
    }
}

The advantage is that we keep the original exception if it's not the one we expected, and that we don't depend on the contents of the message text (don't know, but it may perhaps vary between different JVMs).

> NetworkServerControl.start() should throw an exception and not just  print  exceptions  if the server fails to start
> --------------------------------------------------------------------------------------------------------------------
>
>                 Key: DERBY-1465
>                 URL: https://issues.apache.org/jira/browse/DERBY-1465
>             Project: Derby
>          Issue Type: Bug
>          Components: Network Server
>    Affects Versions: 10.1.2.1
>            Reporter: Kathey Marsden
>            Priority: Minor
>         Attachments: DERBY-1465.diff3, DERBY-1465.diff4, DERBY-1465.diff5, DERBY-1465.diff6, DERBY-1465.diff7, DERBY-1465_diff.txt, DERBY-1465_diff.txt, DERBY-1465_stat.txt, DERBY-1465_stat.txt, releaseNote.html, releaseNote.html, releaseNote.html
>
>
> NetworkServerControl.start()  will not throw an exception  if another server is already running on the same port.    I am not sure but think perhaps this was changed at  one point to accomodate the derby.drda.startNetworkServer property  so that the embedded server could continue to boot even if the network server failed to start, but  I think this is wrong for normal usage.
> http://www.nabble.com/Questions-about-Network-Server-API-Behavior-p5055814.html

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


[jira] Resolved: (DERBY-1465) NetworkServerControl.start() should throw an exception and not just print exceptions if the server fails to start

Posted by "Kathey Marsden (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DERBY-1465?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Kathey Marsden resolved DERBY-1465.
-----------------------------------

       Resolution: Fixed
    Fix Version/s: 10.3.0.0
       Derby Info: [Existing Application Impact, Release Note Needed]  (was: [Existing Application Impact, Patch Available])

Committed revision 540779

> NetworkServerControl.start() should throw an exception and not just  print  exceptions  if the server fails to start
> --------------------------------------------------------------------------------------------------------------------
>
>                 Key: DERBY-1465
>                 URL: https://issues.apache.org/jira/browse/DERBY-1465
>             Project: Derby
>          Issue Type: Bug
>          Components: Network Server
>    Affects Versions: 10.1.2.1
>            Reporter: Kathey Marsden
>         Assigned To: Kathey Marsden
>            Priority: Minor
>             Fix For: 10.3.0.0
>
>         Attachments: DERBY-1465_diff.txt, DERBY-1465_diff.txt, DERBY-1465_stat.txt, DERBY-1465_stat.txt, releaseNote.html
>
>
> NetworkServerControl.start()  will not throw an exception  if another server is already running on the same port.    I am not sure but think perhaps this was changed at  one point to accomodate the derby.drda.startNetworkServer property  so that the embedded server could continue to boot even if the network server failed to start, but  I think this is wrong for normal usage.
> http://www.nabble.com/Questions-about-Network-Server-API-Behavior-p5055814.html

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


[jira] Updated: (DERBY-1465) NetworkServerControl.start() should throw an exception and not just print exceptions if the server fails to start

Posted by "Myrna van Lunteren (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DERBY-1465?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Myrna van Lunteren updated DERBY-1465:
--------------------------------------

    Attachment: releaseNote.html

pretty much the same release note, but replace reference to NetworkServerControlImpl.start() with NetworkServerControl.start()

> NetworkServerControl.start() should throw an exception and not just  print  exceptions  if the server fails to start
> --------------------------------------------------------------------------------------------------------------------
>
>                 Key: DERBY-1465
>                 URL: https://issues.apache.org/jira/browse/DERBY-1465
>             Project: Derby
>          Issue Type: Bug
>          Components: Network Server
>    Affects Versions: 10.1.2.1
>            Reporter: Kathey Marsden
>            Priority: Minor
>         Attachments: DERBY-1465.diff3, DERBY-1465_diff.txt, DERBY-1465_diff.txt, DERBY-1465_stat.txt, DERBY-1465_stat.txt, releaseNote.html, releaseNote.html, releaseNote.html
>
>
> NetworkServerControl.start()  will not throw an exception  if another server is already running on the same port.    I am not sure but think perhaps this was changed at  one point to accomodate the derby.drda.startNetworkServer property  so that the embedded server could continue to boot even if the network server failed to start, but  I think this is wrong for normal usage.
> http://www.nabble.com/Questions-about-Network-Server-API-Behavior-p5055814.html

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


[jira] Commented: (DERBY-1465) NetworkServerControl.start() should throw an exception and not just print exceptions if the server fails to start

Posted by "Bernt M. Johnsen (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DERBY-1465?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12498595 ] 

Bernt M. Johnsen commented on DERBY-1465:
-----------------------------------------

1) I am not going to finish the rewrite of NetworkServerControlImpl for 10.3 (DERBY-2412). My approach to keep the internal code an chop the class into smaller pieces proved not to solve the basic problems. We need to rewrite some basic mechanisms (e.g. exception handling and reporting) first. I plan to do the rewrite for the next release.
2) Yes (or at least make it much easier to fix it).

> NetworkServerControl.start() should throw an exception and not just  print  exceptions  if the server fails to start
> --------------------------------------------------------------------------------------------------------------------
>
>                 Key: DERBY-1465
>                 URL: https://issues.apache.org/jira/browse/DERBY-1465
>             Project: Derby
>          Issue Type: Bug
>          Components: Network Server
>    Affects Versions: 10.1.2.1
>            Reporter: Kathey Marsden
>         Assigned To: Kathey Marsden
>            Priority: Minor
>             Fix For: 10.3.0.0
>
>         Attachments: DERBY-1465_diff.txt, DERBY-1465_diff.txt, DERBY-1465_stat.txt, DERBY-1465_stat.txt, releaseNote.html
>
>
> NetworkServerControl.start()  will not throw an exception  if another server is already running on the same port.    I am not sure but think perhaps this was changed at  one point to accomodate the derby.drda.startNetworkServer property  so that the embedded server could continue to boot even if the network server failed to start, but  I think this is wrong for normal usage.
> http://www.nabble.com/Questions-about-Network-Server-API-Behavior-p5055814.html

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


[jira] Updated: (DERBY-1465) NetworkServerControl.start() should throw an exception and not just print exceptions if the server fails to start

Posted by "Myrna van Lunteren (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DERBY-1465?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Myrna van Lunteren updated DERBY-1465:
--------------------------------------

    Derby Info: [Existing Application Impact, Release Note Needed]  (was: [Release Note Needed, Existing Application Impact, Patch Available])

> NetworkServerControl.start() should throw an exception and not just  print  exceptions  if the server fails to start
> --------------------------------------------------------------------------------------------------------------------
>
>                 Key: DERBY-1465
>                 URL: https://issues.apache.org/jira/browse/DERBY-1465
>             Project: Derby
>          Issue Type: Bug
>          Components: Network Server
>    Affects Versions: 10.1.2.1
>            Reporter: Kathey Marsden
>            Priority: Minor
>         Attachments: DERBY-1465.diff3, DERBY-1465.diff4, DERBY-1465.diff5, DERBY-1465.diff6, DERBY-1465.diff7, DERBY-1465.diff8, DERBY-1465_diff.txt, DERBY-1465_diff.txt, DERBY-1465_stat.txt, DERBY-1465_stat.txt, releaseNote.html, releaseNote.html, releaseNote.html
>
>
> NetworkServerControl.start()  will not throw an exception  if another server is already running on the same port.    I am not sure but think perhaps this was changed at  one point to accomodate the derby.drda.startNetworkServer property  so that the embedded server could continue to boot even if the network server failed to start, but  I think this is wrong for normal usage.
> http://www.nabble.com/Questions-about-Network-Server-API-Behavior-p5055814.html

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


[jira] Commented: (DERBY-1465) NetworkServerControl.start() should throw an exception and not just print exceptions if the server fails to start

Posted by "Daniel John Debrunner (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DERBY-1465?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12498058 ] 

Daniel John Debrunner commented on DERBY-1465:
----------------------------------------------

Could you also explain the lifetime of this new thread then?

Does this change mean that starting the network server now has an extra Thread for the lifetime of the network server?

Does it mean a change in behaviour where previously the JVM could exit but now it cannot until the network server is shutdown?


> NetworkServerControl.start() should throw an exception and not just  print  exceptions  if the server fails to start
> --------------------------------------------------------------------------------------------------------------------
>
>                 Key: DERBY-1465
>                 URL: https://issues.apache.org/jira/browse/DERBY-1465
>             Project: Derby
>          Issue Type: Bug
>          Components: Network Server
>    Affects Versions: 10.1.2.1
>            Reporter: Kathey Marsden
>         Assigned To: Kathey Marsden
>            Priority: Minor
>             Fix For: 10.3.0.0
>
>         Attachments: DERBY-1465_diff.txt, DERBY-1465_diff.txt, DERBY-1465_stat.txt, DERBY-1465_stat.txt, releaseNote.html
>
>
> NetworkServerControl.start()  will not throw an exception  if another server is already running on the same port.    I am not sure but think perhaps this was changed at  one point to accomodate the derby.drda.startNetworkServer property  so that the embedded server could continue to boot even if the network server failed to start, but  I think this is wrong for normal usage.
> http://www.nabble.com/Questions-about-Network-Server-API-Behavior-p5055814.html

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


[jira] Commented: (DERBY-1465) NetworkServerControl.start() should throw an exception and not just print exceptions if the server fails to start

Posted by "Myrna van Lunteren (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DERBY-1465?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12641992#action_12641992 ] 

Myrna van Lunteren commented on DERBY-1465:
-------------------------------------------

Since Bernt has now (see update to DERBY-2412) no plans to complete redesign of NetworkServerControlImpl, I was thinking it might make sense to revisit this issue.

However, I am not sure about one of Dan's comments:
" wonder if the code could be modifed slightly to use the old thread, rather than creating a new thread ... "

I can imagine DRDAServerStarter.boot(...) carrying an additional parameter to indicate whether to throw an exception or not, is that what was meant? Or is there another solution?


> NetworkServerControl.start() should throw an exception and not just  print  exceptions  if the server fails to start
> --------------------------------------------------------------------------------------------------------------------
>
>                 Key: DERBY-1465
>                 URL: https://issues.apache.org/jira/browse/DERBY-1465
>             Project: Derby
>          Issue Type: Bug
>          Components: Network Server
>    Affects Versions: 10.1.2.1
>            Reporter: Kathey Marsden
>            Priority: Minor
>         Attachments: DERBY-1465_diff.txt, DERBY-1465_diff.txt, DERBY-1465_stat.txt, DERBY-1465_stat.txt, releaseNote.html
>
>
> NetworkServerControl.start()  will not throw an exception  if another server is already running on the same port.    I am not sure but think perhaps this was changed at  one point to accomodate the derby.drda.startNetworkServer property  so that the embedded server could continue to boot even if the network server failed to start, but  I think this is wrong for normal usage.
> http://www.nabble.com/Questions-about-Network-Server-API-Behavior-p5055814.html

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


[jira] Commented: (DERBY-1465) NetworkServerControl.start() should throw an exception and not just print exceptions if the server fails to start

Posted by "Myrna van Lunteren (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DERBY-1465?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12649102#action_12649102 ] 

Myrna van Lunteren commented on DERBY-1465:
-------------------------------------------

I wanted to close this today, but I see in the nightlies that this has resulted in an intermittent failure - and with sun jdk 1.4.2, it's all over.
I'll investigate.

> NetworkServerControl.start() should throw an exception and not just  print  exceptions  if the server fails to start
> --------------------------------------------------------------------------------------------------------------------
>
>                 Key: DERBY-1465
>                 URL: https://issues.apache.org/jira/browse/DERBY-1465
>             Project: Derby
>          Issue Type: Bug
>          Components: Network Server
>    Affects Versions: 10.1.2.1
>            Reporter: Kathey Marsden
>            Priority: Minor
>         Attachments: DERBY-1465.diff3, DERBY-1465_diff.txt, DERBY-1465_diff.txt, DERBY-1465_stat.txt, DERBY-1465_stat.txt, releaseNote.html, releaseNote.html, releaseNote.html
>
>
> NetworkServerControl.start()  will not throw an exception  if another server is already running on the same port.    I am not sure but think perhaps this was changed at  one point to accomodate the derby.drda.startNetworkServer property  so that the embedded server could continue to boot even if the network server failed to start, but  I think this is wrong for normal usage.
> http://www.nabble.com/Questions-about-Network-Server-API-Behavior-p5055814.html

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


[jira] Commented: (DERBY-1465) NetworkServerControl.start() should throw an exception and not just print exceptions if the server fails to start

Posted by "Kathey Marsden (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DERBY-1465?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12768855#action_12768855 ] 

Kathey Marsden commented on DERBY-1465:
---------------------------------------

I have been thinking about this issue which I filed back in Jan, 2006.  At the time it seemed to make sense, but now the compatibility risks seem significant, now that Derby has been out for years. I think by now folks have figured out that they need to ping the server to determine if it is up. If it now starts throwing an exception it might cause problems.

I think Myrna's work on this issue has been valuable as it helped expose the issues mentioned in the previous comment, but I am beginning to think we should close this won't fix.  There had been talk about a new API for network server to replace the one that we have, if we do that then the exception on start issue can be taken under consideration.


> NetworkServerControl.start() should throw an exception and not just  print  exceptions  if the server fails to start
> --------------------------------------------------------------------------------------------------------------------
>
>                 Key: DERBY-1465
>                 URL: https://issues.apache.org/jira/browse/DERBY-1465
>             Project: Derby
>          Issue Type: Bug
>          Components: Network Server
>    Affects Versions: 10.1.2.1
>            Reporter: Kathey Marsden
>            Assignee: Myrna van Lunteren
>            Priority: Minor
>         Attachments: DERBY-1465.diff3, DERBY-1465.diff4, DERBY-1465.diff5, DERBY-1465.diff6, DERBY-1465.diff7, DERBY-1465.diff8, DERBY-1465_diff.txt, DERBY-1465_diff.txt, DERBY-1465_stat.txt, DERBY-1465_stat.txt, DERBY-1465hangibm142_12_29_08.txt, DERBY-1465hangibm15_12_29_08.txt, releaseNote.html, releaseNote.html, releaseNote.html
>
>
> NetworkServerControl.start()  will not throw an exception  if another server is already running on the same port.    I am not sure but think perhaps this was changed at  one point to accomodate the derby.drda.startNetworkServer property  so that the embedded server could continue to boot even if the network server failed to start, but  I think this is wrong for normal usage.
> http://www.nabble.com/Questions-about-Network-Server-API-Behavior-p5055814.html

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


[jira] Commented: (DERBY-1465) NetworkServerControl.start() should throw an exception and not just print exceptions if the server fails to start

Posted by "Myrna van Lunteren (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DERBY-1465?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12659851#action_12659851 ] 

Myrna van Lunteren commented on DERBY-1465:
-------------------------------------------

Well, it seems there still is a hang.

With ibm142 on another machine than where I ran my tests before, suites.All is hanging (it's been at it for about 11 hours, should take about 5 hours on this particular machine) - the test run seems wedged currently in testReplication_Local_existingTestsAsReplLoad.

I'll back out my changes...(again). Apologies for the trouble.


> NetworkServerControl.start() should throw an exception and not just  print  exceptions  if the server fails to start
> --------------------------------------------------------------------------------------------------------------------
>
>                 Key: DERBY-1465
>                 URL: https://issues.apache.org/jira/browse/DERBY-1465
>             Project: Derby
>          Issue Type: Bug
>          Components: Network Server
>    Affects Versions: 10.1.2.1
>            Reporter: Kathey Marsden
>            Assignee: Myrna van Lunteren
>            Priority: Minor
>         Attachments: DERBY-1465.diff3, DERBY-1465.diff4, DERBY-1465.diff5, DERBY-1465.diff6, DERBY-1465.diff7, DERBY-1465.diff8, DERBY-1465_diff.txt, DERBY-1465_diff.txt, DERBY-1465_stat.txt, DERBY-1465_stat.txt, releaseNote.html, releaseNote.html, releaseNote.html
>
>
> NetworkServerControl.start()  will not throw an exception  if another server is already running on the same port.    I am not sure but think perhaps this was changed at  one point to accomodate the derby.drda.startNetworkServer property  so that the embedded server could continue to boot even if the network server failed to start, but  I think this is wrong for normal usage.
> http://www.nabble.com/Questions-about-Network-Server-API-Behavior-p5055814.html

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


[jira] Commented: (DERBY-1465) NetworkServerControl.start() should throw an exception and not just print exceptions if the server fails to start

Posted by "Kathey Marsden (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DERBY-1465?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12498061 ] 

Kathey Marsden commented on DERBY-1465:
---------------------------------------

Dan asked:
>Could you also explain the lifetime of this new thread then?
>Does this change mean that starting the network server now has an extra Thread for the lifetime of the network server? 

No.  We used to start with DRDAServerStarter which made a thread to start network server. Now NetworkServerControl

old:
NetworkServerControl.start() called DRDAServerStarter which started a thread calling blockingStart.  blockingStart would log any exceptions.

new:
NetworkServerControl.start() creates its own thread calling blockingStart and throws any exceptions that occur during the startup phase.  To determine the end of the startup phase it waits on serverStartComplete. 
If start is  successful ...
 When blockingStart gets to the point that it would print the server is up, it notifies serverStartComplete so the start method can return or throw any exception that occurred and waits to be shutdown.

If start fais....
blockingStart will throw an exception, notify serverStartComplete  and the thread will end.



> NetworkServerControl.start() should throw an exception and not just  print  exceptions  if the server fails to start
> --------------------------------------------------------------------------------------------------------------------
>
>                 Key: DERBY-1465
>                 URL: https://issues.apache.org/jira/browse/DERBY-1465
>             Project: Derby
>          Issue Type: Bug
>          Components: Network Server
>    Affects Versions: 10.1.2.1
>            Reporter: Kathey Marsden
>         Assigned To: Kathey Marsden
>            Priority: Minor
>             Fix For: 10.3.0.0
>
>         Attachments: DERBY-1465_diff.txt, DERBY-1465_diff.txt, DERBY-1465_stat.txt, DERBY-1465_stat.txt, releaseNote.html
>
>
> NetworkServerControl.start()  will not throw an exception  if another server is already running on the same port.    I am not sure but think perhaps this was changed at  one point to accomodate the derby.drda.startNetworkServer property  so that the embedded server could continue to boot even if the network server failed to start, but  I think this is wrong for normal usage.
> http://www.nabble.com/Questions-about-Network-Server-API-Behavior-p5055814.html

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


[jira] Updated: (DERBY-1465) NetworkServerControl.start() should throw an exception and not just print exceptions if the server fails to start

Posted by "Kathey Marsden (JIRA)" <de...@db.apache.org>.
     [ http://issues.apache.org/jira/browse/DERBY-1465?page=all ]

Kathey Marsden updated DERBY-1465:
----------------------------------

    Summary: NetworkServerControl.start() should throw an exception and not just  print  exceptions  if the server fails to start  (was: NetworkServerControl.start() should throw an exception and not just  print  exceptions  starting network server)

> NetworkServerControl.start() should throw an exception and not just  print  exceptions  if the server fails to start
> --------------------------------------------------------------------------------------------------------------------
>
>          Key: DERBY-1465
>          URL: http://issues.apache.org/jira/browse/DERBY-1465
>      Project: Derby
>         Type: Bug

>   Components: Network Server
>     Versions: 10.1.2.1
>     Reporter: Kathey Marsden
>     Priority: Minor

>
> NetworkServerControl.start()  will not throw an exception  if another server is already running on the same port.    I am not sure but think perhaps this was changed at  one point to accomodate the derby.drda.startNetworkServer property  so that the embedded server could continue to boot even if the network server failed to start, but  I think this is wrong for normal usage.
> http://www.nabble.com/Questions-about-Network-Server-API-Behavior-p5055814.html

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Updated: (DERBY-1465) NetworkServerControl.start() should throw an exception and not just print exceptions if the server fails to start

Posted by "Myrna van Lunteren (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DERBY-1465?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Myrna van Lunteren updated DERBY-1465:
--------------------------------------

    Attachment: DERBY-1465.diff6

Attaching a next iteration - DERBY-1465.diff6

Dan's comment cited by Knut Anders:
"There is a chance the server can fail to start but the start method will not throw any exceptions, because the waiter is notified before 'runtimeException' is set, thus the waiter may see runtimeException as null and not throw an exception"
was actually addressed by patch 4.
(patch 5 corrected the fact that the runtimeException never got set to null, so you'd get that message all the time).

Patch 6 I think addresses the second logic issue spotted by Knut Anders:
"since blockingStart() calls startNetworkServer() before the try/finally block, it's possible that an exception is thrown without completedBoot being set to true, which will leave the main thread waiting forever"
This is addressed by (simply) setting completedBoot to true when an error is encountered. 

I ran NSinSameTest withouth problems 50 times (this at one time would reproduce the hang occassionally). I ran suitesall 4 times on 2 different windows machines, and derbyall once, and I hit the following known problems:
- DERBY-654; derbyall: unit/T_RawStoreFactory.unit
< -- Unit Test T_RawStoreFactory finished
 2 add
 > There should be 0 observers, but we still have 1 observers.
> Shutting down due to unit test failure.
   (maybe this is a j9 technology issue rather than j2me).
- DERBY-3915: 
1) testReplication_Local_3_p3_StateNegativeTests
(org.apache.derbyTesting.functionTests.tests.replicationTests.ReplicationRun_Local_3_p3)
junit.framework.AssertionFailedError: Expected SQLState'08004', but got connection!
-  DERBY-3689:
1) testAttributeAccumulatedConnectionCount(org.apache.derbyTesting.functionTests.tests.management.NetworkServerMBeanTest)
java.security.PrivilegedActionException: javax.management.InstanceNotFoundException: 
- DERBY-3757:
1) testStressMulti(org.apache.derbyTesting.functionTests.tests.multi.StressMultiTest)junit.framework.AssertionFailedError: 
Caused by: 
java.sql.SQLException: Java exception: 'ASSERT FAILED transaction table has null entry: 
org.apache.derby.shared.common.sanity.AssertFailure'.

In addition, I got: 
1) ttestSetPortPriority(org.apache.derbyTesting.functionTests.tests.derbynet.ServerPropertiesTest)
junit.framework.AssertionFailedError: failed to start server with port 1529
	at org.apache.derbyTesting.functionTests.tests.derbynet.ServerPropertiesTest.checkWhetherNeedToShutdown(ServerPropertiesTest.java:378)
I think this is probably the same as DERBY-3873, or DERBY-2779, but because we now throw the Exception when the server doesn't start, we see the problem earlier. Which is exactly what this fix is intended to do.

So I think this is ok now.

Ready for review.

> NetworkServerControl.start() should throw an exception and not just  print  exceptions  if the server fails to start
> --------------------------------------------------------------------------------------------------------------------
>
>                 Key: DERBY-1465
>                 URL: https://issues.apache.org/jira/browse/DERBY-1465
>             Project: Derby
>          Issue Type: Bug
>          Components: Network Server
>    Affects Versions: 10.1.2.1
>            Reporter: Kathey Marsden
>            Priority: Minor
>         Attachments: DERBY-1465.diff3, DERBY-1465.diff4, DERBY-1465.diff5, DERBY-1465.diff6, DERBY-1465_diff.txt, DERBY-1465_diff.txt, DERBY-1465_stat.txt, DERBY-1465_stat.txt, releaseNote.html, releaseNote.html, releaseNote.html
>
>
> NetworkServerControl.start()  will not throw an exception  if another server is already running on the same port.    I am not sure but think perhaps this was changed at  one point to accomodate the derby.drda.startNetworkServer property  so that the embedded server could continue to boot even if the network server failed to start, but  I think this is wrong for normal usage.
> http://www.nabble.com/Questions-about-Network-Server-API-Behavior-p5055814.html

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


[jira] Commented: (DERBY-1465) NetworkServerControl.start() should throw an exception and not just print exceptions if the server fails to start

Posted by "Knut Anders Hatlen (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DERBY-1465?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12659110#action_12659110 ] 

Knut Anders Hatlen commented on DERBY-1465:
-------------------------------------------

Right, I assumed that the BindException was in the exception chain, but I see now that that's not the case. If we just want to preserve the exception in case it's an unexpected one in the test, we could simply do this and ignore that we don't really have a BindException in the chain:

catch (Exception e) {
    if (e.getMessage().indexOf("java.net.BindException") == -1) {
        throw e;
    }
}

As to the issue of preserving the original exception when a BindException (or any other exception) is thrown, I think the problem here is that consolePropertyMessage() only takes the message to print as an argument. Since it in many cases generates and throws a new exception, it should also take the underlying exception as an argument, and it should either re-throw it or put it in the chain with initCause() so that we preserve the stack trace of the root cause. It doesn't have to be fixed as part of this issue, but I think it would be worth fixing.

> NetworkServerControl.start() should throw an exception and not just  print  exceptions  if the server fails to start
> --------------------------------------------------------------------------------------------------------------------
>
>                 Key: DERBY-1465
>                 URL: https://issues.apache.org/jira/browse/DERBY-1465
>             Project: Derby
>          Issue Type: Bug
>          Components: Network Server
>    Affects Versions: 10.1.2.1
>            Reporter: Kathey Marsden
>            Priority: Minor
>         Attachments: DERBY-1465.diff3, DERBY-1465.diff4, DERBY-1465.diff5, DERBY-1465.diff6, DERBY-1465.diff7, DERBY-1465_diff.txt, DERBY-1465_diff.txt, DERBY-1465_stat.txt, DERBY-1465_stat.txt, releaseNote.html, releaseNote.html, releaseNote.html
>
>
> NetworkServerControl.start()  will not throw an exception  if another server is already running on the same port.    I am not sure but think perhaps this was changed at  one point to accomodate the derby.drda.startNetworkServer property  so that the embedded server could continue to boot even if the network server failed to start, but  I think this is wrong for normal usage.
> http://www.nabble.com/Questions-about-Network-Server-API-Behavior-p5055814.html

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


[jira] Updated: (DERBY-1465) NetworkServerControl.start() should throw an exception and not just print exceptions if the server fails to start

Posted by "Myrna van Lunteren (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DERBY-1465?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Myrna van Lunteren updated DERBY-1465:
--------------------------------------

    Attachment: DERBY-1465.diff4

Attaching a patch that I think gets around the trouble the previous attempt caused in the nightly tests.

However, I need to do some more research before I commit - I ran suites.All twice, once I got this failure:
--------------------------------
1) testStartStopManagementFromApplication(org.apache.derbyTesting.functionTests.tests.management.ManagementMBeanTest)junit.framework.AssertionFailedError: expected:<4> but was:<6>
	at org.apache.derbyTesting.functionTests.tests.management.ManagementMBeanTest.startStopManagement(ManagementMBeanTest.java:76)
	at org.apache.derbyTesting.functionTests.tests.management.ManagementMBeanTest.testStartStopManagementFromApplication(ManagementMBeanTest.java:56)
--------------------------------
I think I get this intermittently, so this may be unrelated.
But once I got a hang after an error:
--------------------------------
testXAConnection used 0 ms EEjava.lang.Exception: DRDA_InvalidReplyTooShort.S:Invalid reply from network server: Insufficient data.
	at org.apache.derby.impl.drda.NetworkServerControlImpl.consolePropertyMessageWork(Unknown Source)
	at org.apache.derby.impl.drda.NetworkServerControlImpl.consolePropertyMessage(Unknown Source)
	at org.apache.derby.impl.drda.NetworkServerControlImpl.fillReplyBuffer(Unknown Source)
	at org.apache.derby.impl.drda.NetworkServerControlImpl.readResult(Unknown Source)
	at org.apache.derby.impl.drda.NetworkServerControlImpl.pingWithNoOpen(Unknown Source)
	at org.apache.derby.impl.drda.NetworkServerControlImpl.ping(Unknown Source)
	at org.apache.derby.drda.NetworkServerControl.ping(Unknown Source)
	at org.apache.derbyTesting.junit.NetworkServerTestSetup.pingForServerUp(NetworkServerTestSetup.java:561)
	at org.apache.derbyTesting.junit.NetworkServerTestSetup.pingForServerStart(NetworkServerTestSetup.java:630)
	at org.apache.derbyTesting.junit.NetworkServerTestSetup.setUp(NetworkServerTestSetup.java:191)
	at junit.extensions.TestSetup$1.protect(TestSetup.java:18)
	at junit.framework.TestResult.runProtected(TestResult.java:124)
	at junit.extensions.TestSetup.run(TestSetup.java:23)
	at org.apache.derbyTesting.junit.BaseTestSetup.run(BaseTestSetup.java:57)
	at junit.extensions.TestDecorator.basicRun(TestDecorator.java:22)
	at junit.extensions.TestSetup$1.protect(TestSetup.java:19)
	at junit.framework.TestResult.runProtected(TestResult.java:124)
	at junit.extensions.TestSetup.run(TestSetup.java:23)
	at junit.extensions.TestDecorator.basicRun(TestDecorator.java:22)
	at junit.extensions.TestSetup$1.protect(TestSetup.java:19)
	at junit.framework.TestResult.runProtected(TestResult.java:124)
	at junit.extensions.TestSetup.run(TestSetup.java:23)
	at junit.framework.TestSuite.runTest(TestSuite.java:208)
	at junit.framework.TestSuite.run(TestSuite.java:203)
	at junit.framework.TestSuite.runTest(TestSuite.java:208)
	at junit.framework.TestSuite.run(TestSuite.java:203)
	at junit.framework.TestSuite.runTest(TestSuite.java:208)
	at junit.framework.TestSuite.run(TestSuite.java:203)
	at junit.framework.TestSuite.runTest(TestSuite.java:208)
	at junit.framework.TestSuite.run(TestSuite.java:203)
	at junit.textui.TestRunner.doRun(TestRunner.java:116)
	at junit.textui.TestRunner.start(TestRunner.java:172)
	at junit.textui.TestRunner.main(TestRunner.java:138)
--------------------------------

> NetworkServerControl.start() should throw an exception and not just  print  exceptions  if the server fails to start
> --------------------------------------------------------------------------------------------------------------------
>
>                 Key: DERBY-1465
>                 URL: https://issues.apache.org/jira/browse/DERBY-1465
>             Project: Derby
>          Issue Type: Bug
>          Components: Network Server
>    Affects Versions: 10.1.2.1
>            Reporter: Kathey Marsden
>            Priority: Minor
>         Attachments: DERBY-1465.diff3, DERBY-1465.diff4, DERBY-1465_diff.txt, DERBY-1465_diff.txt, DERBY-1465_stat.txt, DERBY-1465_stat.txt, releaseNote.html, releaseNote.html, releaseNote.html
>
>
> NetworkServerControl.start()  will not throw an exception  if another server is already running on the same port.    I am not sure but think perhaps this was changed at  one point to accomodate the derby.drda.startNetworkServer property  so that the embedded server could continue to boot even if the network server failed to start, but  I think this is wrong for normal usage.
> http://www.nabble.com/Questions-about-Network-Server-API-Behavior-p5055814.html

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


[jira] Updated: (DERBY-1465) NetworkServerControl.start() should throw an exception and not just print exceptions if the server fails to start

Posted by "Kathey Marsden (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DERBY-1465?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Kathey Marsden updated DERBY-1465:
----------------------------------

    Attachment: DERBY-1465_diff.txt

Attached is a patch for this issue.  I ran derbynetclientmats, derbynetmats and suites.All.
I am a little unsure about this patch.  I wait only 5 seconds for any error to occur on startup.  It will catch the most common error that there is already another server on the same port, but still the server can't be verified as up until ping is successful.   I'll submit another patch for DERBY-1467 which allows a timeout to be specified.  That seems the preferred way to go.




> NetworkServerControl.start() should throw an exception and not just  print  exceptions  if the server fails to start
> --------------------------------------------------------------------------------------------------------------------
>
>                 Key: DERBY-1465
>                 URL: https://issues.apache.org/jira/browse/DERBY-1465
>             Project: Derby
>          Issue Type: Bug
>          Components: Network Server
>    Affects Versions: 10.1.2.1
>            Reporter: Kathey Marsden
>         Assigned To: Kathey Marsden
>            Priority: Minor
>         Attachments: DERBY-1465_diff.txt
>
>
> NetworkServerControl.start()  will not throw an exception  if another server is already running on the same port.    I am not sure but think perhaps this was changed at  one point to accomodate the derby.drda.startNetworkServer property  so that the embedded server could continue to boot even if the network server failed to start, but  I think this is wrong for normal usage.
> http://www.nabble.com/Questions-about-Network-Server-API-Behavior-p5055814.html

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