An air lock is a restriction of, or complete stoppage of liquid flow caused by gas trapped in a high point of a liquid-filled pipe system. The gas, being less dense than the liquid, rises to any high points. When pressure is applied, instead of the liquid flowing as it would if the system was full of liquid, the system behaves like a series of manometers.
Flushing the system with high flow or pressures can help move the gas away from the highest point, or a tap (or automatic vent valve) can be installed to let the gas out.
Air lock problems often occur when one is trying to recommission a system after it has been deliberately (for servicing) or accidentally emptied. For example, a central heating system using a circulating pump to pump water through radiators. When filling such a system, air is trapped in the radiators. This air has to be vented using screw valves built into the radiators. Depending on the pipe layout - if there are any upside down 'U's in the circuit - it will be necessary to vent the highest point(s). If not, air lock may stop flow through that part of the circuit completely. Note that circulating pumps usually do not generate enough pressure to overcome air locks.
Fig 1 shows a reservoir which feeds a gravity distribution system – for drinking water or irrigation. If the ground in which the pipe is laid has high points – such as Hi1, 2 etc. and low points between them such as Lo1, 2 etc., then if the pipe is filled from the top, and was empty, the pipe fills OK as far as Hi1. If the water flow velocity is below the rising velocity of air bubbles [ref], then water trickles down to the low point Lo2 and traps the remaining air between Hi1 and Lo2. As more water flows down, the upward leg Lo2 to Hi2 fills up. This exerts a pressure on the trapped air of either H2 m of water (WG = water gauge) or H1, whichever is less. If H2 is greater than H1, then you have a full air lock, and the water level in the up leg Lo2 to Hi2 stops at H1 and no further water can flow. If H1 is greater than H2, then some water can flow, but the full pipe hydraulic head H3 will not be reached and so flow is much less than expected. If there are further undulations, then the back pressure effects add together. Obviously long pipelines over fairly level, but undulating land, are bound to have many such high and low points. To avoid air or gas lock, automatic vents are fitted which let air or gas out when above a certain pressure. They may also be designed to let air in under vacuum. There are many other design considerations for design of water pipeline systems e.g. 
The air lock phenomenon can be used in a number of useful ways. The diagram to the right shows an 'S' trap. This has the properties a) that liquid can flow from top (1) to bottom (4) unhindered and b) that gas cannot flow through the trap unless it has enough extra pressure to overcome the liquid head of the trap. This is usually about 75 to 100 mm of water and prevents foul smelling air coming back from foul water drainage systems via connections to toilets, sinks and so on. 'S' traps work well unless the drainage water has sand in it - which then collects in the 'U' part of the 'S'.
- “UNDERSTANDING GRAVITY-FLOW PIPELINES” Water Flow, Air Locks and Siphons published by British Columbia, Ministry of Agriculture and Lands. www.agf.gov.bc.ca/resmgmt/publist/500Series/590304-5.pdf