File: external-sockets.txt

package info (click to toggle)
dmtcp 2.6.0-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 6,496 kB
  • sloc: cpp: 33,592; ansic: 28,099; sh: 6,735; makefile: 1,950; perl: 1,690; python: 1,241; asm: 138; java: 13
file content (52 lines) | stat: -rw-r--r-- 2,423 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
				External Sockets
[ This is still in draft form.  It must be expanded and re-written. ]

[Support for EXTERNAL SOCKETS has been removed from trunk]

An external socket is a connection between two processes, where only
one of the processes is under DMTCP checkpoint control.

In the longer run, we want to offer users configure options about what
to do with "external sockets" at checkpoint time.  
Reasonable choices for this are:
1) the external sockets are temporary; don't checkpoint yet, and 
   the application will close the sockets; DMTCP can block any thread
   that tries to open a new socket, if it is waiting to do a checkpoint.
   [ This is the choice made with the config flag:  --condor-mode ]
2) go ahead and checkpoint immediately;  but don't save any external
   sockets, and don't restore them;  On restart, the application will
   see that socket as a "dead socket", and should use its own error
   recovery to create a new socket if needed.
   [ DMTCP does this now for certain special cases.  One example is that
     vim will open a connection to the X-Window server.  On restart,
     we can't restart the X-Window server.  So, we make the socket
     appear to be a dead socket on restart.  (Philsophy:  Well-behaved
     applications should not assume that very long-lived connections
     will continue forever (e.g. due to temporary network outage), and
     should have an error recovery strategy.) ]

Besides vim, another good example of software that silently creates
an external socket is:  getpwuid() in libc.so when LDAP is configured.

For implementation details, some items of note are:
connection.h:markExternalConnect()
connection.cpp:_makeDeadSocket
connection.cpp: case TCP_EXTERNAL_CONNECT:
connection.h:  markExternalConnect()

Notice that in:
connectionmanager.cpp:dmtcp::KernelDeviceToConnection::retrieve()
  If DMTCP did not record a particular connection (e.g. done in the case
  of the special LDAP ports), and if it is of type 'socket', then
  is is marked TCP_EXTERNAL_CONNECT and not restored.

Note also:
connection.cpp:_isBlacklistedTcp()
  It maintains blacklistedRemotePorts (currently only the LDAP ports),
  and at restart time, those connections will be recreated as dead sockets.
  (As of rev. 1270, this is not done for vim connecting to X-Windows.
   The X-Windows port is simply closed.  But this would be an alternative
   strategy.)


TCP_EXTERNAL_CONNECT,