Quantcast

Review: Saving the pipes opened for connection and free the memory of all these pipes in cli_nt_pipes_close function.

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Review: Saving the pipes opened for connection and free the memory of all these pipes in cli_nt_pipes_close function.

Nagendra008
Hi All,

Here i am trying to free the pipes one after other inside "cli_nt_pipes_close" of all the pipes which opened for connection.
Can anyone please review these below changes with respective samba-4.5.6.

Without any change inside "cli_nt_pipes_close" directly freeing entire pipe list talloc_free(cli->pipe_list);


- Here i am trying to Save the pipes opened for connection and free the memory of all these pipes

"source3/rpc_client/cli_pipe.h"

NTSTATUS rpc_pipe_open_tcp(struct cli_state *cli, TALLOC_CTX *mem_ctx,
                           const char *host,
                           const struct sockaddr_storage *ss_addr,
                           const struct ndr_interface_table *table,
                           struct rpc_pipe_client **presult);



/**
 * Create a rpc pipe client struct, connecting to a host via tcp.
 * The port is determined by asking the endpoint mapper on the given
 * host.
 */
NTSTATUS rpc_pipe_open_tcp(struct cli_state *cli, TALLOC_CTX *mem_ctx, const char *host,
                           const struct sockaddr_storage *addr,
                           const struct ndr_interface_table *table,
                           struct rpc_pipe_client **presult)
{
        NTSTATUS status;
        uint16_t port = 0;

        status = rpc_pipe_get_tcp_port(host, addr, table, &port);
        if (!NT_STATUS_IS_OK(status)) {
                goto done;
        }

        status = rpc_pipe_open_tcp_port(mem_ctx, host, addr, port,
                                      table, presult, 1000);
                                                                         
//Saving the pipes opened for connection and free the memory of all these pipes in cli_nt_pipes_close function.
    if (*presult)
    {
        DLIST_ADD(cli->pipe_list, *presult);
    }

done:

    return status;
}


Sending cli to rpc_pipe_open_tcp
------------------------------------------------------------------
"source3/torture/rpc_open_tcp.c"

status = rpc_pipe_open_tcp(cli, mem_ctx, argv[2], NULL,
                                   *table,
                                   &rpc_pipe);
                                                   



For graceful freeing of pipes by one after other
/****************************************************************************
 Close all pipes open on this session.
****************************************************************************/

void cli_nt_pipes_close(struct cli_state *cli)
{

    struct rpc_pipe_client *tmp, *pipe = cli->pipe_list;
        while (pipe) {
                /*
                 * No TALLOC_FREE here!
                 */
        tmp = pipe->next;
                talloc_free(pipe);
        pipe = tmp;
        }
}


Regards,
Nag
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Review: Saving the pipes opened for connection and free the memory of all these pipes in cli_nt_pipes_close function.

Samba - samba-technical mailing list
On Fri, Apr 07, 2017 at 12:01:58AM -0700, Nagendra008 via samba-technical wrote:
> Hi All,
>
> Here i am trying to free the pipes one after other inside
> "cli_nt_pipes_close" of all the pipes which opened for connection.
> *Can anyone please review these below changes with respective samba-4.5.6.*

Can you send these changes as an attachment created with
diff -u please ? It's really hard to know what you're trying to
do from the text you sent.

Thanks,

        Jeremy.

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Review: Saving the pipes opened for connection and free the memory of all these pipes and samba pipe open timeout.

Nagendra008
Hi Jeremy,

Please review the below changes with respective samba-4.5.6.

- I am attaching the patch diff for freeing the pipes opened connection and samba pipe open timeout.
- samba-4.5.6-clientgen_ib.patchpipe-samba-4-5-6.patch
  - "Saving the pipes opened for connection and free the memory of all these pipes (For graceful freeing of pipes by one after other) "

- samba-4.5.6-connection-timeout_ib.patch connection-timeout_samba-4-5-6.patch
   - Increase the samba open pipe timeout.
   - This patch uses the hard coded value for timeout value. We allow the user to induce timeout value.

Regards,
Nagendra
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Review: Saving the pipes opened for connection and free the memory of all these pipes and samba pipe open timeout.

Samba - samba-technical mailing list
On Mon, Apr 10, 2017 at 11:52:03PM -0700, Nagendra008 via samba-technical wrote:

> Hi Jeremy,
>
> Please review the below changes with respective *samba-4.5.*6.
>
> - I am attaching the patch diff for *freeing the pipes opened connection and
> samba pipe open timeout*.
> - samba-4.5.6-clientgen_ib.patch pipe-samba-4-5-6.patch
> <http://samba.2283325.n4.nabble.com/file/n4717367/pipe-samba-4-5-6.patch>  
>   - "Saving the pipes opened for connection and free the memory of all these
> pipes (For graceful freeing of pipes by one after other) "
>
> - samba-4.5.6-connection-timeout_ib.patch
> connection-timeout_samba-4-5-6.patch
> <http://samba.2283325.n4.nabble.com/file/n4717367/connection-timeout_samba-4-5-6.patch>  
>    - Increase the samba open pipe timeout.
>    - This patch uses the hard coded value for timeout value. We allow the
> user to induce timeout value.

Hi Nagendra,

Can you explain what you're tring to achieve with
these patches ?

Thanks !

Jeremy.

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Review: Saving the pipes opened for connection and free the memory of all these pipes and samba pipe open timeout.

Nagendra008
Hi Jeremy,

pipe-samba-4-5-6.patch

- Here i am trying to Save the pipes opened for connection and free the memory of all these pipes.
- For graceful freeing of pipes by one after other.
- Reason:
  - In samba-3.4.4 we are seeing cores to avoid cores we added this pipe-samba-3.4.4.patch for samba-3.4.4 and same patch we add in samba-4.5.6
  - Can you say is this patch is needed with respective samaba-4.5.6


connection-timeout_samba-4-5-6.patch

- Increase the samba pipe open timeout from 60ms&250ms to 2500ms to overcome a longer network delay.(only OK for rtt<2500ms)
- We allow the users to induce timeout value for network connection delay.
- Replace hard coded timeout value in functions open_socket_out_connected and rpc_pipe_open_tcp_port.
- with new field time not a hard coded value.

Thanks,
Nag
Loading...