[ 
https://issues.apache.org/jira/browse/DERBY-4786?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Mamta A. Satoor updated DERBY-4786:
-----------------------------------

    Attachment: DERBY4786_patch2_diff.txt

Attaching a new patch, DERBY4786_patch2_diff.txt, which sends shutdown command 
with protocol level 2 whether there is username or password provided or not. If 
this command fails because of DRDA_InvalidReplyHead from server, then resend 
the shutdown command but this time with protocol level 1. The attempt with 
protocol level 1 will be made only if there was no username and password 
supplied with the shutdown command. 

One issue I noticed this with change is if a client with the changes proposed 
by this patch sends a shutdown command to a 10.3 server(which does not have 
DERBY-2109 changes) without the username and password, it will get 2 exceptions 
back from the server. 1st exception will be for sending the shutdown command at 
protocol level 2 and the 2nd will be for shutting down the server succesfully. 
Server will also have 2 messages, first indicating that an invalid protocol 
level command was received and 2nd message saying that the server is shutdown. 
Let me show that by example

Client with the patch applied will show following when it is trying to shutdown 
a 10.3 server
$ java org.apache.derby.drda.NetworkServerControl -noSecurityManager shutdown
Tue Sep 07 21:57:10 PDT 2010 : Invalid reply header from network server: 
Invalid string  ←. Plaintext connection attempt to an SSL enabled server?
Tue Sep 07 21:57:11 PDT 2010 : Apache Derby Network Server - 10.7.0.0 alpha - 
(1) shutdown

The 10.3 server would show following for a shutdown command from a trunk 
client(with the patch applied)
java.lang.Throwable: DRDA_UnknownProtocol.S, <2>
        at 
org.apache.derby.impl.drda.NetworkServerControlImpl.processCommands(NetworkServerControlImpl.java:1509)
        at 
org.apache.derby.impl.drda.DRDAConnThread.sessionInitialState(DRDAConnThread.java:602)
        at 
org.apache.derby.impl.drda.DRDAConnThread.run(DRDAConnThread.java:266)
Execution failed because of a Distributed Protocol Error:  
DRDA_Proto_SYNTAXRM;CODPNT arg  = 0; Error Code Value = 1. Plaintext connection 
attempt from an SSL enabled client?
org.apache.derby.impl.drda.DRDAProtocolException: Execution failed because of a 
Distributed Protocol Error:  DRDA_Proto_SYNTAXRM; CODPNT arg  = 0; Error Code 
Value = 1. Plaintext connection attempt from an SSL enabled client?
        at 
org.apache.derby.impl.drda.DRDAConnThread.throwSyntaxrm(DRDAConnThread.java:470)
        at 
org.apache.derby.impl.drda.DDMReader.readDssHeader(DDMReader.java:340)
        at 
org.apache.derby.impl.drda.DRDAConnThread.processCommands(DRDAConnThread.java:673)
        at 
org.apache.derby.impl.drda.DRDAConnThread.run(DRDAConnThread.java:277)
Execution failed because of a Distributed Protocol Error:  
DRDA_Proto_SYNTAXRM;CODPNT arg  = 0; Error Code Value = 1. Plaintext connection 
attempt from an SSL enabled client?
org.apache.derby.impl.drda.DRDAProtocolException: Execution failed because of a 
Distributed Protocol Error:  DRDA_Proto_SYNTAXRM; CODPNT arg  = 0; Error Code 
Value = 1. Plaintext connection attempt from an SSL enabled client?
        at 
org.apache.derby.impl.drda.DRDAConnThread.throwSyntaxrm(DRDAConnThread.java:470)
        at 
org.apache.derby.impl.drda.DDMReader.readDssHeader(DDMReader.java:340)
        at 
org.apache.derby.impl.drda.DRDAConnThread.processCommands(DRDAConnThread.java:673)
        at 
org.apache.derby.impl.drda.DRDAConnThread.run(DRDAConnThread.java:277)
Apache Derby Network Server - 10.3.3.1 - (1) shutdown at {2}

I am not sure if we should try to mask this exception for the shutdown attempt 
with protocol level 2. Is it an ususal case any ways that a 10.3 server is 
being shutdown with a higher release client? Should we just document this 
behavior?

> Shutdown command without username and password should work with mixed client 
> and network server releases.
> ---------------------------------------------------------------------------------------------------------
>
>                 Key: DERBY-4786
>                 URL: https://issues.apache.org/jira/browse/DERBY-4786
>             Project: Derby
>          Issue Type: Bug
>          Components: Network Client, Network Server
>    Affects Versions: 10.4.1.3, 10.4.2.0, 10.5.1.1, 10.6.1.0
>            Reporter: Mamta A. Satoor
>            Assignee: Mamta A. Satoor
>         Attachments: DERBY4786_patch1_diff.txt, DERBY4786_patch2_diff.txt
>
>
> DERBY-2109 introduced optional parameters username and password to the 
> shutdown command. But with this fix, the existing shutdown command which does 
> not use username and password stopped working from client with DERBY-2109 
> changes against a network server without DERBY-2109 changes.
> This jira is to ensure that existing shutdown command without user name and 
> password still works fine between different releases of client and network 
> server(with or without DERBY-2109). The new shutdown command introduced by 
> DERBY-2109 will work obviosuly only on client and server with DERBY-2109 
> changes. For client/server not with DERBY-2109 changes attempting to user use 
> name and password will get an error.

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

Reply via email to