While mirroring, data fields not preserved, posted by Rob Calkins on Tue Oct 26 01:21:01 2021
|
While running two e-log books that were mirrored, I ended up with the situation of two entries with the same number/id. The mirroring did what it said it would, increment the local logbook entry and grab the entry from the remote logbook. However, when it did, it did not preserve the fields in the log book that are specified in the config file such as "Author", "Priority", "Subject" ect. I ended up with a very minimal log:
|
Too many open files - issue?, posted by Rob Calkins on Fri Oct 15 23:57:38 2021
|
Has anyone had issues with having too many files open? I'll setup my server and let it go but after a while, I end up with a lot of "cannot create socket: Too many open files" errors being reported. I have a sync to another e-log going which I suspect is part of the cause since that e-log server hasn't had this issue. I suspect that there are files being opened, going into some return loop code and then never getting closed. I'm not a C programmer but I see lines like :
fh = open(tmp_filename, O_RDONLY);
if (fh > 0) {
read(fh, result, size - 1);
close(fh);
}
/* remove temporary file */
remove(tmp_filename);
This looks like it opens the file but unless the remove function closes the file, it will remain open even through the file has been deleted. Maybe this isn't the correct behaviour of 'remove' and I am mistaken?
There are also parts like :
fh = open(textfile, O_RDONLY | O_BINARY);
if (fh < 0) {
printf("Message file \"%s\" does not exist.\n", textfile);
return 1;
}
size = (INT) lseek(fh, 0, SEEK_END);
lseek(fh, 0, SEEK_SET);
if (size > (INT) (sizeof(text) - 1)) {
printf("Message file \"%s\" is too long (%zd bytes max).\n", textfile, sizeof(text));
return 1;
}
This looks like for the second error, it will complain that the file is too long, return an error message but not close the file and would leave it open. Is this a reasonable avenue to pursue or am I mis-reading the code? Thanks.
|
Re: Too many open files - issue?, posted by Stefan Ritt on Mon Oct 25 13:34:06 2021
|
The code segements you show are from the command line tool elog.c, not the server elogd.c. The tool is called to submit a new message from the command line. Even if there would be a file not properly closed, it will be closed by the operating system once the program finishes. So no problem of too many open files there.
Rob Calkins wrote: |
Has anyone had issues with having too many files open? I'll setup my server and let it go but after a while, I end up with a lot of "cannot create socket: Too many open files" errors being reported. I have a sync to another e-log going which I suspect is part of the cause since that e-log server hasn't had this issue. I suspect that there are files being opened, going into some return loop code and then never getting closed. I'm not a C programmer but I see lines like :
fh = open(tmp_filename, O_RDONLY);
if (fh > 0) {
read(fh, result, size - 1);
close(fh);
}
/* remove temporary file */
remove(tmp_filename);
This looks like it opens the file but unless the remove function closes the file, it will remain open even through the file has been deleted. Maybe this isn't the correct behaviour of 'remove' and I am mistaken?
There are also parts like :
fh = open(textfile, O_RDONLY | O_BINARY);
if (fh < 0) {
printf("Message file \"%s\" does not exist.\n", textfile);
return 1;
}
size = (INT) lseek(fh, 0, SEEK_END);
lseek(fh, 0, SEEK_SET);
if (size > (INT) (sizeof(text) - 1)) {
printf("Message file \"%s\" is too long (%zd bytes max).\n", textfile, sizeof(text));
return 1;
}
This looks like for the second error, it will complain that the file is too long, return an error message but not close the file and would leave it open. Is this a reasonable avenue to pursue or am I mis-reading the code? Thanks.
|
|
Display last page by default, posted by Yoshio Imai on Fri Oct 28 12:15:33 2005
|
Hi again!
I have one question concerning the logbook configuration. Normally, clicking on "List" takes me to the first page of the list view. Is it possible to configure the logbook so that "List" takes me to the last page instead?
Yoshio |
Re: Display last page by default, posted by Stefan Ritt on Fri Oct 28 12:16:38 2005
|
Yoshio Imai wrote: | Is it possible to configure the logbook so that "List" takes me to the last page instead? |
Reverse sort = 1 |
Re: Display last page by default, posted by Yoshio Imai on Fri Oct 28 12:39:44 2005
|
Stefan Ritt wrote: |
Reverse sort = 1 |
Thanks for the quick reply. Unfortunately, this is not exactly what we need. We would like to see the entries in normal order, but the last of the pages as "start page". Is it possible to configure this?
Yoshio |
Re: Display last page by default, posted by Stefan Ritt on Fri Oct 28 13:05:26 2005
|
Yoshio Imai wrote: | We would like to see the entries in normal order, but the last of the pages as "start page". Is it possible to configure this? |
Start page = 0?cmd=last
Well, I guess this is not what you want either, correct? You would like to see the listing page with ~20 entries. The first one you can access easily via "<logbook>/page1", but the number of the last page varies over time. I would have to add a new functionality like "<lobook>/page_last", which automatically gets converted into the correct page number. I will put this on my wishlist. |
Re: Display last page by default, posted by Yoshio Imai on Fri Oct 28 13:12:46 2005
|
Thanks!
For the moment, I could satisfy the users by setting the start page to the "All" view, but if it can be implemented in a future version, this would come very handy.
Yoshio |
Re: Display last page by default, posted by Stefan Ritt on Fri Oct 28 13:14:19 2005
|
Yoshio Imai wrote: | We would like to see the entries in normal order, but the last of the pages as "start page". Is it possible to configure this? |
What about
Start page = last10
This shows always the last 10 entries. If you want to see more, you can click on the new menu entry "Last 20 entries" etc. |
Re: Display last page by default, posted by Yoshio Imai on Fri Oct 28 13:24:27 2005
|
Stefan Ritt wrote: |
What about
Start page = last10
|
In principle this would be a good starting point, however, we would like to use the "Previous" and "Next" page selectors to browse (and these don't appear when using the "lastNN" statement for the start page). |
Re: Display last page by default, posted by Stefan Ritt on Fri Oct 28 20:36:55 2005
|
Ok, I implemented the last page display per default in revision 1538. If "reverse sort = 0" the last page is shown and if "reverse sort = 1" the first page is shown by default. This way one always sees the page with the latest entries. I hope this accomodates everybody. If not, please complain and I could make it a switch (yet another option ). |
Re: Display last page by default, posted by Yoshio Imai on Mon Oct 31 01:39:52 2005
|
I have installed the new version, and it works just fine. It is also MUCH faster than my intermediate solution.
Quote: |
For the moment, I could satisfy the users by setting the start page to the "All" view
|
Thanks for the work! |
Display last page by default, posted by Yoshio Imai on Fri Oct 28 12:15:33 2005
|
Hi again!
I have one question concerning the logbook configuration. Normally, clicking on "List" takes me to the first page of the list view. Is it possible to configure the logbook so that "List" takes me to the last page instead?
Yoshio |
Re: Display last page by default, posted by Stefan Ritt on Fri Oct 28 12:16:38 2005
|
Yoshio Imai wrote: | Is it possible to configure the logbook so that "List" takes me to the last page instead? |
Reverse sort = 1 |
Re: Display last page by default, posted by Yoshio Imai on Fri Oct 28 12:39:44 2005
|
Stefan Ritt wrote: |
Reverse sort = 1 |
Thanks for the quick reply. Unfortunately, this is not exactly what we need. We would like to see the entries in normal order, but the last of the pages as "start page". Is it possible to configure this?
Yoshio |
Re: Display last page by default, posted by Stefan Ritt on Fri Oct 28 13:05:26 2005
|
Yoshio Imai wrote: | We would like to see the entries in normal order, but the last of the pages as "start page". Is it possible to configure this? |
Start page = 0?cmd=last
Well, I guess this is not what you want either, correct? You would like to see the listing page with ~20 entries. The first one you can access easily via "<logbook>/page1", but the number of the last page varies over time. I would have to add a new functionality like "<lobook>/page_last", which automatically gets converted into the correct page number. I will put this on my wishlist. |
Re: Display last page by default, posted by Yoshio Imai on Fri Oct 28 13:12:46 2005
|
Thanks!
For the moment, I could satisfy the users by setting the start page to the "All" view, but if it can be implemented in a future version, this would come very handy.
Yoshio |
Re: Display last page by default, posted by Stefan Ritt on Fri Oct 28 13:14:19 2005
|
Yoshio Imai wrote: | We would like to see the entries in normal order, but the last of the pages as "start page". Is it possible to configure this? |
What about
Start page = last10
This shows always the last 10 entries. If you want to see more, you can click on the new menu entry "Last 20 entries" etc. |
Re: Display last page by default, posted by Yoshio Imai on Fri Oct 28 13:24:27 2005
|
Stefan Ritt wrote: |
What about
Start page = last10
|
In principle this would be a good starting point, however, we would like to use the "Previous" and "Next" page selectors to browse (and these don't appear when using the "lastNN" statement for the start page). |
Re: Display last page by default, posted by Stefan Ritt on Fri Oct 28 20:36:55 2005
|
Ok, I implemented the last page display per default in revision 1538. If "reverse sort = 0" the last page is shown and if "reverse sort = 1" the first page is shown by default. This way one always sees the page with the latest entries. I hope this accomodates everybody. If not, please complain and I could make it a switch (yet another option ). |
Re: Display last page by default, posted by Yoshio Imai on Mon Oct 31 01:39:52 2005
|
I have installed the new version, and it works just fine. It is also MUCH faster than my intermediate solution.
Quote: |
For the moment, I could satisfy the users by setting the start page to the "All" view
|
Thanks for the work! |
Display last page by default, posted by Yoshio Imai on Fri Oct 28 12:15:33 2005
|
Hi again!
I have one question concerning the logbook configuration. Normally, clicking on "List" takes me to the first page of the list view. Is it possible to configure the logbook so that "List" takes me to the last page instead?
Yoshio |
Re: Display last page by default, posted by Stefan Ritt on Fri Oct 28 12:16:38 2005
|
Yoshio Imai wrote: | Is it possible to configure the logbook so that "List" takes me to the last page instead? |
Reverse sort = 1 |
Re: Display last page by default, posted by Yoshio Imai on Fri Oct 28 12:39:44 2005
|
Stefan Ritt wrote: |
Reverse sort = 1 |
Thanks for the quick reply. Unfortunately, this is not exactly what we need. We would like to see the entries in normal order, but the last of the pages as "start page". Is it possible to configure this?
Yoshio |
Re: Display last page by default, posted by Stefan Ritt on Fri Oct 28 13:05:26 2005
|
Yoshio Imai wrote: | We would like to see the entries in normal order, but the last of the pages as "start page". Is it possible to configure this? |
Start page = 0?cmd=last
Well, I guess this is not what you want either, correct? You would like to see the listing page with ~20 entries. The first one you can access easily via "<logbook>/page1", but the number of the last page varies over time. I would have to add a new functionality like "<lobook>/page_last", which automatically gets converted into the correct page number. I will put this on my wishlist. |
Re: Display last page by default, posted by Yoshio Imai on Fri Oct 28 13:12:46 2005
|
Thanks!
For the moment, I could satisfy the users by setting the start page to the "All" view, but if it can be implemented in a future version, this would come very handy.
Yoshio |
Re: Display last page by default, posted by Stefan Ritt on Fri Oct 28 13:14:19 2005
|
Yoshio Imai wrote: | We would like to see the entries in normal order, but the last of the pages as "start page". Is it possible to configure this? |
What about
Start page = last10
This shows always the last 10 entries. If you want to see more, you can click on the new menu entry "Last 20 entries" etc. |
Re: Display last page by default, posted by Yoshio Imai on Fri Oct 28 13:24:27 2005
|
Stefan Ritt wrote: |
What about
Start page = last10
|
In principle this would be a good starting point, however, we would like to use the "Previous" and "Next" page selectors to browse (and these don't appear when using the "lastNN" statement for the start page). |
Re: Display last page by default, posted by Stefan Ritt on Fri Oct 28 20:36:55 2005
|
Ok, I implemented the last page display per default in revision 1538. If "reverse sort = 0" the last page is shown and if "reverse sort = 1" the first page is shown by default. This way one always sees the page with the latest entries. I hope this accomodates everybody. If not, please complain and I could make it a switch (yet another option ). |
Re: Display last page by default, posted by Yoshio Imai on Mon Oct 31 01:39:52 2005
|
I have installed the new version, and it works just fine. It is also MUCH faster than my intermediate solution.
Quote: |
For the moment, I could satisfy the users by setting the start page to the "All" view
|
Thanks for the work! |
Display last page by default, posted by Yoshio Imai on Fri Oct 28 12:15:33 2005
|
Hi again!
I have one question concerning the logbook configuration. Normally, clicking on "List" takes me to the first page of the list view. Is it possible to configure the logbook so that "List" takes me to the last page instead?
Yoshio |
Re: Display last page by default, posted by Stefan Ritt on Fri Oct 28 12:16:38 2005
|
Yoshio Imai wrote: | Is it possible to configure the logbook so that "List" takes me to the last page instead? |
Reverse sort = 1 |
Re: Display last page by default, posted by Yoshio Imai on Fri Oct 28 12:39:44 2005
|
Stefan Ritt wrote: |
Reverse sort = 1 |
Thanks for the quick reply. Unfortunately, this is not exactly what we need. We would like to see the entries in normal order, but the last of the pages as "start page". Is it possible to configure this?
Yoshio |
Re: Display last page by default, posted by Stefan Ritt on Fri Oct 28 13:05:26 2005
|
Yoshio Imai wrote: | We would like to see the entries in normal order, but the last of the pages as "start page". Is it possible to configure this? |
Start page = 0?cmd=last
Well, I guess this is not what you want either, correct? You would like to see the listing page with ~20 entries. The first one you can access easily via "<logbook>/page1", but the number of the last page varies over time. I would have to add a new functionality like "<lobook>/page_last", which automatically gets converted into the correct page number. I will put this on my wishlist. |
Re: Display last page by default, posted by Yoshio Imai on Fri Oct 28 13:12:46 2005
|
Thanks!
For the moment, I could satisfy the users by setting the start page to the "All" view, but if it can be implemented in a future version, this would come very handy.
Yoshio |
Re: Display last page by default, posted by Stefan Ritt on Fri Oct 28 13:14:19 2005
|
Yoshio Imai wrote: | We would like to see the entries in normal order, but the last of the pages as "start page". Is it possible to configure this? |
What about
Start page = last10
This shows always the last 10 entries. If you want to see more, you can click on the new menu entry "Last 20 entries" etc. |
Re: Display last page by default, posted by Yoshio Imai on Fri Oct 28 13:24:27 2005
|
Stefan Ritt wrote: |
What about
Start page = last10
|
In principle this would be a good starting point, however, we would like to use the "Previous" and "Next" page selectors to browse (and these don't appear when using the "lastNN" statement for the start page). |
Re: Display last page by default, posted by Stefan Ritt on Fri Oct 28 20:36:55 2005
|
Ok, I implemented the last page display per default in revision 1538. If "reverse sort = 0" the last page is shown and if "reverse sort = 1" the first page is shown by default. This way one always sees the page with the latest entries. I hope this accomodates everybody. If not, please complain and I could make it a switch (yet another option ). |
Re: Display last page by default, posted by Yoshio Imai on Mon Oct 31 01:39:52 2005
|
I have installed the new version, and it works just fine. It is also MUCH faster than my intermediate solution.
Quote: |
For the moment, I could satisfy the users by setting the start page to the "All" view
|
Thanks for the work! |
Display last page by default, posted by Yoshio Imai on Fri Oct 28 12:15:33 2005
|
Hi again!
I have one question concerning the logbook configuration. Normally, clicking on "List" takes me to the first page of the list view. Is it possible to configure the logbook so that "List" takes me to the last page instead?
Yoshio |
Re: Display last page by default, posted by Stefan Ritt on Fri Oct 28 12:16:38 2005
|
Yoshio Imai wrote: | Is it possible to configure the logbook so that "List" takes me to the last page instead? |
Reverse sort = 1 |
Re: Display last page by default, posted by Yoshio Imai on Fri Oct 28 12:39:44 2005
|
Stefan Ritt wrote: |
Reverse sort = 1 |
Thanks for the quick reply. Unfortunately, this is not exactly what we need. We would like to see the entries in normal order, but the last of the pages as "start page". Is it possible to configure this?
Yoshio |
Re: Display last page by default, posted by Stefan Ritt on Fri Oct 28 13:05:26 2005
|
Yoshio Imai wrote: | We would like to see the entries in normal order, but the last of the pages as "start page". Is it possible to configure this? |
Start page = 0?cmd=last
Well, I guess this is not what you want either, correct? You would like to see the listing page with ~20 entries. The first one you can access easily via "<logbook>/page1", but the number of the last page varies over time. I would have to add a new functionality like "<lobook>/page_last", which automatically gets converted into the correct page number. I will put this on my wishlist. |
Re: Display last page by default, posted by Yoshio Imai on Fri Oct 28 13:12:46 2005
|
Thanks!
For the moment, I could satisfy the users by setting the start page to the "All" view, but if it can be implemented in a future version, this would come very handy.
Yoshio |
Re: Display last page by default, posted by Stefan Ritt on Fri Oct 28 13:14:19 2005
|
Yoshio Imai wrote: | We would like to see the entries in normal order, but the last of the pages as "start page". Is it possible to configure this? |
What about
Start page = last10
This shows always the last 10 entries. If you want to see more, you can click on the new menu entry "Last 20 entries" etc. |
Re: Display last page by default, posted by Yoshio Imai on Fri Oct 28 13:24:27 2005
|
Stefan Ritt wrote: |
What about
Start page = last10
|
In principle this would be a good starting point, however, we would like to use the "Previous" and "Next" page selectors to browse (and these don't appear when using the "lastNN" statement for the start page). |
Re: Display last page by default, posted by Stefan Ritt on Fri Oct 28 20:36:55 2005
|
Ok, I implemented the last page display per default in revision 1538. If "reverse sort = 0" the last page is shown and if "reverse sort = 1" the first page is shown by default. This way one always sees the page with the latest entries. I hope this accomodates everybody. If not, please complain and I could make it a switch (yet another option ). |
Re: Display last page by default, posted by Yoshio Imai on Mon Oct 31 01:39:52 2005
|
I have installed the new version, and it works just fine. It is also MUCH faster than my intermediate solution.
Quote: |
For the moment, I could satisfy the users by setting the start page to the "All" view
|
Thanks for the work! |
Display last page by default, posted by Yoshio Imai on Fri Oct 28 12:15:33 2005
|
Hi again!
I have one question concerning the logbook configuration. Normally, clicking on "List" takes me to the first page of the list view. Is it possible to configure the logbook so that "List" takes me to the last page instead?
Yoshio |
Re: Display last page by default, posted by Stefan Ritt on Fri Oct 28 12:16:38 2005
|
Yoshio Imai wrote: | Is it possible to configure the logbook so that "List" takes me to the last page instead? |
Reverse sort = 1 |
Re: Display last page by default, posted by Yoshio Imai on Fri Oct 28 12:39:44 2005
|
Stefan Ritt wrote: |
Reverse sort = 1 |
Thanks for the quick reply. Unfortunately, this is not exactly what we need. We would like to see the entries in normal order, but the last of the pages as "start page". Is it possible to configure this?
Yoshio |
Re: Display last page by default, posted by Stefan Ritt on Fri Oct 28 13:05:26 2005
|
Yoshio Imai wrote: | We would like to see the entries in normal order, but the last of the pages as "start page". Is it possible to configure this? |
Start page = 0?cmd=last
Well, I guess this is not what you want either, correct? You would like to see the listing page with ~20 entries. The first one you can access easily via "<logbook>/page1", but the number of the last page varies over time. I would have to add a new functionality like "<lobook>/page_last", which automatically gets converted into the correct page number. I will put this on my wishlist. |
Re: Display last page by default, posted by Yoshio Imai on Fri Oct 28 13:12:46 2005
|
Thanks!
For the moment, I could satisfy the users by setting the start page to the "All" view, but if it can be implemented in a future version, this would come very handy.
Yoshio |
Re: Display last page by default, posted by Stefan Ritt on Fri Oct 28 13:14:19 2005
|
Yoshio Imai wrote: | We would like to see the entries in normal order, but the last of the pages as "start page". Is it possible to configure this? |
What about
Start page = last10
This shows always the last 10 entries. If you want to see more, you can click on the new menu entry "Last 20 entries" etc. |
Re: Display last page by default, posted by Yoshio Imai on Fri Oct 28 13:24:27 2005
|
Stefan Ritt wrote: |
What about
Start page = last10
|
In principle this would be a good starting point, however, we would like to use the "Previous" and "Next" page selectors to browse (and these don't appear when using the "lastNN" statement for the start page). |
Re: Display last page by default, posted by Stefan Ritt on Fri Oct 28 20:36:55 2005
|
Ok, I implemented the last page display per default in revision 1538. If "reverse sort = 0" the last page is shown and if "reverse sort = 1" the first page is shown by default. This way one always sees the page with the latest entries. I hope this accomodates everybody. If not, please complain and I could make it a switch (yet another option ). |
Re: Display last page by default, posted by Yoshio Imai on Mon Oct 31 01:39:52 2005
|
I have installed the new version, and it works just fine. It is also MUCH faster than my intermediate solution.
Quote: |
For the moment, I could satisfy the users by setting the start page to the "All" view
|
Thanks for the work! |