Opened 9 years ago
Closed 9 years ago
#2775 closed defect (fixed)
Hangs when closing db drivers
Reported by: | rblazek | Owned by: | |
---|---|---|---|
Priority: | blocker | Milestone: | 7.0.3 |
Component: | Database | Version: | unspecified |
Keywords: | Cc: | ||
CPU: | Unspecified | Platform: | Linux |
Description
Module hangs if db drivers are not closed in revers order to the order in which were opened. For example open driver A, open driver B, close driver A hangs forever on waitpid() in G_wait() because driver process does not exit when its stdin is closed in db_shutdown_driver() by fclose(driver->send). fclose() returns 0 (ok). The driver is probably hanging on db__recv_procnum() even if stdin was closed.
It is fixed by enabling procedure DB_PROC_SHUTDOWN_DRIVER like it is used on Window. Patch attached.
Attachments (2)
Change History (12)
by , 9 years ago
Attachment: | close-driver.patch added |
---|
comment:1 by , 9 years ago
comment:3 by , 9 years ago
More from Glynn about the possibility to close all descriptors https://lists.osgeo.org/pipermail/grass-dev/2015-October/077010.html which does not seem to be optimal.
I think that both patches should be applied. The second is resolving the real problem. The first, explicitly sending close procedure to driver cannot harm and it should also cover all cases when a descriptor is opened (even not db related) without setting FD_CLOEXEC.
Backport would be useful.
comment:4 by , 9 years ago
Milestone: | 7.0.1 → 7.0.3 |
---|
comment:5 by , 9 years ago
Priority: | normal → blocker |
---|
Likely relevant for the winGRASS (64bit), promoting to blocker since patches are provided.
follow-up: 7 comment:6 by , 9 years ago
I took liberty to apply both patches in trunk (r67290). Testing highly welcomed before we do backport to relbr70 (must be done before 7.0.3RC1)
follow-up: 8 comment:7 by , 9 years ago
comment:8 by , 9 years ago
Replying to mlennert:
Replying to martinl:
I took liberty to apply both patches in trunk (r67290). Testing highly welcomed before we do backport to relbr70 (must be done before 7.0.3RC1)
Any ideas of how to test this specifically ?
svn cat https://svn.osgeo.org/grass/sandbox/martinl/test-2775.c > test-2775.c gcc test-2775.c -I/path/to/grassheaders -lgrass_dbmiclient -L/path/to/grasslibs ./a.out
will hang when closing db1
closing db1
comment:9 by , 9 years ago
After testing I took liberty to backport changes also to relbr70 - r67369. Now the sample program finishes successfully also here.
closing db1 closing db2
comment:10 by , 9 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
Closing the ticket, feel free to re-open if needed.
Annother fix suggested by Glynn and resolving the real problem also works https://lists.osgeo.org/pipermail/grass-dev/2015-October/076925.html
Patch attached.