rpc: check the ctx->listener before accessing rpcsvc object
Change-Id: I3c913d1fab07deb41eec05c5adc29a3964315b43 BUG: 858487 Signed-off-by: Raghavendra Bhat <raghavendra@redhat.com> Reviewed-on: http://review.gluster.org/4230 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Anand Avati <avati@redhat.com>
This commit is contained in:
parent
6d1607becc
commit
ee2813f440
@ -973,9 +973,17 @@ cleanup_and_exit (int signum)
|
||||
|
||||
ctx->cleanup_started = 1;
|
||||
glusterfs_mgmt_pmap_signout (ctx);
|
||||
if (ctx->listener) {
|
||||
(void) glusterfs_listener_stop (ctx);
|
||||
}
|
||||
|
||||
/* below part is a racy code where the rpcsvc object is freed.
|
||||
* But in another thread (epoll thread), upon poll error in the
|
||||
* socket the transports are cleaned up where again rpcsvc object
|
||||
* is accessed (which is already freed by the below function).
|
||||
* Since the process is about to be killed dont execute the function
|
||||
* below.
|
||||
*/
|
||||
/* if (ctx->listener) { */
|
||||
/* (void) glusterfs_listener_stop (ctx); */
|
||||
/* } */
|
||||
|
||||
/* Call fini() of FUSE xlator first:
|
||||
* so there are no more requests coming and
|
||||
|
@ -407,6 +407,14 @@ gf_print_trace (int32_t signum, glusterfs_ctx_t *ctx)
|
||||
|
||||
fd = fileno (ctx->log.gf_log_logfile);
|
||||
|
||||
/* Now every gf_log call will just write to a buffer and when the
|
||||
* buffer becomes full, its written to the log-file. Suppose the process
|
||||
* crashes and prints the backtrace in the log-file, then the previous
|
||||
* log information will still be in the buffer itself. So flush the
|
||||
* contents of the buffer to the log file before printing the backtrace
|
||||
* which helps in debugging.
|
||||
*/
|
||||
fflush (ctx->log.gf_log_logfile);
|
||||
/* Pending frames, (if any), list them in order */
|
||||
ret = write (fd, "pending frames:\n", 16);
|
||||
if (ret < 0)
|
||||
|
Loading…
x
Reference in New Issue
Block a user