Fossil

Check-in [918e1ddd]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:If the "fds" query parameter is provided, then the /test-backoffice-lease webpage shows the open file descriptors.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 918e1ddd8e566541a7786d7280208390ff6bab04aef3b84edb80ff9164b632bf
User & Date: drh 2018-08-08 16:20:25
Context
2018-08-08
17:57
In the backoffice process, close the 0, 1, and 2 file descriptiors and reopen them as /dev/null, on unix. check-in: 6865fb72 user: drh tags: backoffice-full-close
17:21
Added initial version of www/forum.wiki document and a link to it from the front page. check-in: 4ed14b1f user: wyoung tags: trunk
16:20
If the "fds" query parameter is provided, then the /test-backoffice-lease webpage shows the open file descriptors. check-in: 918e1ddd user: drh tags: trunk
14:40
Turn backoffice-nodelay on by default. check-in: af599d6a user: drh tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/backoffice.c.

75
76
77
78
79
80
81

82
83
84
85
86
87
88
...
487
488
489
490
491
492
493













494
495
496
497
498
499
500
# endif
# define GETPID (int)GetCurrentProcessId
#else
# include <unistd.h>
# include <sys/types.h>
# include <signal.h>
# include <errno.h>

# define GETPID getpid
#endif

/*
** The BKOFCE_LEASE_TIME is the amount of time for which a single backoffice
** processing run is valid.  Each backoffice run monopolizes the lease for
** at least this amount of time.  Hopefully all backoffice processing is
................................................................................
  }
  @ </td></tr>
  @ <tr><th>tmNext:</th><td>%lld(x.tmNext)</td><td></td><td>\
  if( x.tmNext>0 ){
    @ (now%+lld(x.tmNext-tmNow)) \
  }
  @ </td></tr>













  @ </table>
  style_footer();
}

/*
** If backoffice processing is needed set the backofficeDb variable to the
** name of the database file.  If no backoffice processing is needed,







>







 







>
>
>
>
>
>
>
>
>
>
>
>
>







75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
...
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
# endif
# define GETPID (int)GetCurrentProcessId
#else
# include <unistd.h>
# include <sys/types.h>
# include <signal.h>
# include <errno.h>
# include <fcntl.h>
# define GETPID getpid
#endif

/*
** The BKOFCE_LEASE_TIME is the amount of time for which a single backoffice
** processing run is valid.  Each backoffice run monopolizes the lease for
** at least this amount of time.  Hopefully all backoffice processing is
................................................................................
  }
  @ </td></tr>
  @ <tr><th>tmNext:</th><td>%lld(x.tmNext)</td><td></td><td>\
  if( x.tmNext>0 ){
    @ (now%+lld(x.tmNext-tmNow)) \
  }
  @ </td></tr>
#ifndef _WIN32
  if( P("fds")!=0 ){
    int i;
    @ <tr><th>open fds:</th><td colspan="3">
    for(i=0; i<1000; i++){
      int rc = fcntl(i, F_GETFL, 0);
      if( rc<0 ) continue;
      @ %d(i) \
    }
    @ </td></tr>
  }
#endif

  @ </table>
  style_footer();
}

/*
** If backoffice processing is needed set the backofficeDb variable to the
** name of the database file.  If no backoffice processing is needed,